linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: lee.jones@linaro.org
Cc: linux-kernel@vger.kernel.org, heiko@sntech.de,
	linux-rockchip@lists.infradead.org, smoch@web.de
Subject: [PATCH v2 2/5] mfd: rk808: Ensure suspend/resume hooks always work
Date: Sun, 12 Jan 2020 01:55:01 +0000	[thread overview]
Message-ID: <e2cd9aa88c96f69fd931d606e0e70784c3020551.1578789410.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1578789410.git.robin.murphy@arm.com>

The RK809/RK817 suspend/resume hooks should not have to depend on
whether this driver owns the pm_power_off hook, and thus the global
rk808_i2c_client is set - indeed, the GPIO-based control is really
only relevant when PSCI firmware is in charge of power rather than
the kernel. As driver model callbacks, they have an appropriate
device argument to hand, so can just always use that.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/mfd/rk808.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index 616e44e7ef98..ac798053c26a 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -712,7 +712,7 @@ static int rk808_remove(struct i2c_client *client)
 
 static int __maybe_unused rk8xx_suspend(struct device *dev)
 {
-	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+	struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
 	int ret = 0;
 
 	switch (rk808->variant) {
@@ -732,7 +732,7 @@ static int __maybe_unused rk8xx_suspend(struct device *dev)
 
 static int __maybe_unused rk8xx_resume(struct device *dev)
 {
-	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+	struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
 	int ret = 0;
 
 	switch (rk808->variant) {
-- 
2.17.1


  parent reply	other threads:[~2020-01-12  1:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12  1:54 [PATCH v2 0/5] mfd: RK8xx tidyup Robin Murphy
2020-01-12  1:55 ` [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested Robin Murphy
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` Robin Murphy [this message]
2020-02-26 10:32   ` [PATCH v2 2/5] mfd: rk808: Ensure suspend/resume hooks always work Lee Jones
2020-01-12  1:55 ` [PATCH v2 3/5] mfd: rk808: Stop using syscore ops Robin Murphy
2020-02-26  9:45   ` Lee Jones
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` [PATCH v2 4/5] mfd: rk808: Reduce shutdown duplication Robin Murphy
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` [PATCH v2 5/5] mfd: rk808: Convert RK805 to shutdown/suspend hooks Robin Murphy
2020-02-26 10:33   ` Lee Jones
2020-01-12 10:17 ` [PATCH v2 0/5] mfd: RK8xx tidyup Soeren Moch
2020-01-13 14:51 ` Anand Moon
2020-02-18 21:44 ` Robin Murphy
2020-04-27 18:41 ` Anand Moon
2020-04-27 18:46   ` Soeren Moch
2020-04-27 18:56     ` Anand Moon

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=e2cd9aa88c96f69fd931d606e0e70784c3020551.1578789410.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=heiko@sntech.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=smoch@web.de \
    /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;
as well as URLs for NNTP newsgroup(s).