summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2020-01-12 04:55:01 +0300
committerLee Jones <lee.jones@linaro.org>2020-03-30 09:35:27 +0300
commit08e8c0d9e9fa78e62a51d5d7af608a70d29ca473 (patch)
tree97df37add03cf57b5f3ef224cc9695a152ad6f3b /drivers/mfd
parentd8f083a302f7f69eecd513ce1aa828cfff41f0cf (diff)
downloadlinux-08e8c0d9e9fa78e62a51d5d7af608a70d29ca473.tar.xz
mfd: rk808: Ensure suspend/resume hooks always work
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/rk808.c4
1 files 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) {