From: Pierre Bourdon Date: Tue, 20 Feb 2018 15:03:18 +0000 (+0100) Subject: max17042: propagate of_node to power supply device X-Git-Tag: v4.17-rc1~155^2~4^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66ec32fc7cd116dab5c02603ea8ec28ff92da3b5;p=thirdparty%2Fkernel%2Flinux.git max17042: propagate of_node to power supply device 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 Signed-off-by: Andre Heider Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 35dde81b1c9b3..1a568df383db8 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -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. */