mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Bourdon <delroth@google.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Pierre Bourdon <delroth@google.com>,
	Andre Heider <a.heider@gmail.com>,
	Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] max17042: propagate of_node to power supply device
Date: Tue, 20 Feb 2018 16:03:18 +0100	[thread overview]
Message-ID: <20180220150318.138827-1-delroth@google.com> (raw)

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

             reply	other threads:[~2018-02-20 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 15:03 Pierre Bourdon [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180220150318.138827-1-delroth@google.com \
    --to=delroth@google.com \
    --cc=a.heider@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®