[PATCH 5/8] mfd: max77705: Fix wakeup source leaks on device unbind

Krzysztof Kozlowski posted 8 patches 10 months, 1 week ago
[PATCH 5/8] mfd: max77705: Fix wakeup source leaks on device unbind
Posted by Krzysztof Kozlowski 10 months, 1 week ago
Device can be unbound, so driver must also release memory for the wakeup
source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/mfd/max77705.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/max77705.c b/drivers/mfd/max77705.c
index 60c457c21d952c2ad485f29619e014f5b85a2087..6b263bacb8c28d980e890777452db58be84d7338 100644
--- a/drivers/mfd/max77705.c
+++ b/drivers/mfd/max77705.c
@@ -131,7 +131,9 @@ static int max77705_i2c_probe(struct i2c_client *i2c)
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to register child devices\n");
 
-	device_init_wakeup(dev, true);
+	ret = devm_device_init_wakeup(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to init wakeup\n");
 
 	return 0;
 }

-- 
2.45.2