Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Robin Murphy and committed by
Lee Jones
08e8c0d9 d8f083a3

+2 -2
+2 -2
drivers/mfd/rk808.c
··· 712 712 713 713 static int __maybe_unused rk8xx_suspend(struct device *dev) 714 714 { 715 - struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client); 715 + struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev)); 716 716 int ret = 0; 717 717 718 718 switch (rk808->variant) { ··· 732 732 733 733 static int __maybe_unused rk8xx_resume(struct device *dev) 734 734 { 735 - struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client); 735 + struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev)); 736 736 int ret = 0; 737 737 738 738 switch (rk808->variant) {