aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2025-04-06 19:50:15 +0000
committerLee Jones <[email protected]>2025-05-23 07:49:12 +0000
commit82ae581e56c36dbaee4e8da12d52018eeca01d4a (patch)
treef13c4f3507ac76c76ea1640016c475d63fed2862
parentmfd: max8925: Fix wakeup source leaks on device unbind (diff)
downloadkernel-82ae581e56c36dbaee4e8da12d52018eeca01d4a.tar.gz
kernel-82ae581e56c36dbaee4e8da12d52018eeca01d4a.zip
mfd: rt5033: Fix wakeup source leaks on device unbind
Device can be unbound, so driver must also release memory for the wakeup source. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
-rw-r--r--drivers/mfd/rt5033.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c
index 84ebc96f58e4..2204bf1c5a51 100644
--- a/drivers/mfd/rt5033.c
+++ b/drivers/mfd/rt5033.c
@@ -98,7 +98,11 @@ static int rt5033_i2c_probe(struct i2c_client *i2c)
return ret;
}
- device_init_wakeup(rt5033->dev, rt5033->wakeup);
+ if (rt5033->wakeup) {
+ ret = devm_device_init_wakeup(rt5033->dev);
+ if (ret)
+ return dev_err_probe(rt5033->dev, ret, "Failed to init wakeup\n");
+ }
return 0;
}