Skip to content

Commit

Permalink
max17042: propagate of_node to power supply device
Browse files Browse the repository at this point in the history
max17042_get_status uses the core power_supply_am_i_supplied. That
function relies on DT properties to figure out the power supply
topology, and will error out without DT.

Fixes max17042 battery status being reported as "unknown".

Signed-off-by: Pierre Bourdon <[email protected]>
Signed-off-by: Andre Heider <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
  • Loading branch information
delroth authored and sre committed Mar 12, 2018
1 parent 4a9be94 commit 66ec32f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/power/supply/max17042_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ static int max17042_probe(struct i2c_client *client,

i2c_set_clientdata(client, chip);
psy_cfg.drv_data = chip;
psy_cfg.of_node = dev->of_node;

/* When current is not measured,
* CURRENT_NOW and CURRENT_AVG properties should be invisible. */
Expand Down

0 comments on commit 66ec32f

Please sign in to comment.