mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] max17042: propagate of_node to power supply device
@ 2018-02-20 15:03 Pierre Bourdon
  2018-02-20 17:34 ` Andy Shevchenko
  2018-02-22 20:40 ` Sebastian Reichel
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre Bourdon @ 2018-02-20 15:03 UTC (permalink / raw)
  Cc: Pierre Bourdon, Andre Heider, Sebastian Reichel, linux-pm, linux-kernel

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: Andre Heider <a.heider@gmail.com>
---
 drivers/power/supply/max17042_battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 35dde81b1c9b..1a568df383db 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. */
-- 
2.16.1.291.g4437f3f132-goog

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-22 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 15:03 [PATCH] max17042: propagate of_node to power supply device Pierre Bourdon
2018-02-20 17:34 ` Andy Shevchenko
2018-02-20 17:58   ` Pierre Bourdon (delroth)
2018-02-22 20:46     ` Sebastian Reichel
2018-02-22 20:40 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®