Skip to content

Commit 08e8c0d

Browse files
rmurphy-armLee Jones
authored andcommitted
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 <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent d8f083a commit 08e8c0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mfd/rk808.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static int rk808_remove(struct i2c_client *client)
712712

713713
static int __maybe_unused rk8xx_suspend(struct device *dev)
714714
{
715-
struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
715+
struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
716716
int ret = 0;
717717

718718
switch (rk808->variant) {
@@ -732,7 +732,7 @@ static int __maybe_unused rk8xx_suspend(struct device *dev)
732732

733733
static int __maybe_unused rk8xx_resume(struct device *dev)
734734
{
735-
struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
735+
struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
736736
int ret = 0;
737737

738738
switch (rk808->variant) {

0 commit comments

Comments
 (0)