Commit 8ba9b030 authored by Pierre Bourdon's avatar Pierre Bourdon Committed by Greg Kroah-Hartman

max17042: propagate of_node to power supply device

[ Upstream commit 66ec32fc ]

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: default avatarPierre Bourdon <delroth@google.com>
Signed-off-by: default avatarAndre Heider <a.heider@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ed6244e8
...@@ -1021,6 +1021,7 @@ static int max17042_probe(struct i2c_client *client, ...@@ -1021,6 +1021,7 @@ static int max17042_probe(struct i2c_client *client,
i2c_set_clientdata(client, chip); i2c_set_clientdata(client, chip);
psy_cfg.drv_data = chip; psy_cfg.drv_data = chip;
psy_cfg.of_node = dev->of_node;
/* When current is not measured, /* When current is not measured,
* CURRENT_NOW and CURRENT_AVG properties should be invisible. */ * CURRENT_NOW and CURRENT_AVG properties should be invisible. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment