drivers/power/mcp73871.c: Fix MCP73871 driver to register correctly as a battery charger. The first element of a 'struct battery_charger_dev_s' should be a pointer to operations structure.
This commit is contained in:
parent
5575f41e05
commit
7127df3e38
@ -93,14 +93,15 @@
|
||||
|
||||
struct mcp73871_dev_s
|
||||
{
|
||||
/* MCP73871 configuration helpers */
|
||||
|
||||
FAR struct mcp73871_config_s *config;
|
||||
|
||||
/* The common part of the battery driver visible to the upper-half driver */
|
||||
|
||||
FAR const struct battery_charger_operations_s *ops; /* Battery operations */
|
||||
|
||||
sem_t batsem; /* Enforce mutually exclusive access */
|
||||
|
||||
/* MCP73871 configuration helpers */
|
||||
|
||||
FAR struct mcp73871_config_s *config;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -399,14 +400,14 @@ FAR struct battery_charger_dev_s *
|
||||
{
|
||||
FAR struct mcp73871_dev_s *priv;
|
||||
|
||||
/* Initialize the BQ2425x device structure */
|
||||
/* Allocate the MCP73871 device structure */
|
||||
|
||||
priv = (FAR struct mcp73871_dev_s *)
|
||||
kmm_zalloc(sizeof(struct mcp73871_dev_s));
|
||||
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the BQ2425x device structure */
|
||||
/* Initialize the MCP73871 device structure */
|
||||
|
||||
nxsem_init(&priv->batsem, 0, 1);
|
||||
priv->ops = &g_mcp73871ops;
|
||||
|
@ -352,7 +352,7 @@ void generate_definitions(FILE *stream)
|
||||
printf("#define %s 1\n", varname);
|
||||
}
|
||||
|
||||
/* Or to '2' if it has the special value "m" */
|
||||
/* Or to '2' if it has the special value 'm' */
|
||||
|
||||
else if (strcmp(varval, "m") == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user