diff mbox series

[2/3] iio: adc: qcom-spmi-iadc: Fix wakeup source leaks on device unbind

Message ID 20250406-b4-device-wakeup-leak-iio-v1-2-2d7d322a4a93@linaro.org (mailing list archive)
State New
Headers show
Series iio: Fix wakeup source leaks on device unbind | expand

Commit Message

Krzysztof Kozlowski April 6, 2025, 8:01 p.m. UTC
Device can be unbound, so driver must also release memory for the wakeup
source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/adc/qcom-spmi-iadc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c
index 7fb8b2499a1d00e4a020da893181e693650726bd..b64a8a407168bbc109e6ea9a63b8c4e492ac5bf4 100644
--- a/drivers/iio/adc/qcom-spmi-iadc.c
+++ b/drivers/iio/adc/qcom-spmi-iadc.c
@@ -543,7 +543,9 @@  static int iadc_probe(struct platform_device *pdev)
 		else
 			return ret;
 	} else {
-		device_init_wakeup(iadc->dev, 1);
+		ret = devm_device_init_wakeup(iadc->dev);
+		if (ret)
+			return dev_err_probe(iadc->dev, ret, "Failed to init wakeup\n");
 	}
 
 	ret = iadc_update_offset(iadc);