[PATCH 3/8] mfd: max14577: Fix wakeup source leaks on device unbind

Krzysztof Kozlowski posted 8 patches 10 months, 1 week ago
[PATCH 3/8] mfd: max14577: 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/max14577.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 6fce79ec2dc64682ef4d85f22d762ec8e2ce1adb..7e7e8af9af224660557e76c2b80d92b05c86d202 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -456,6 +456,7 @@ static void max14577_i2c_remove(struct i2c_client *i2c)
 {
 	struct max14577 *max14577 = i2c_get_clientdata(i2c);
 
+	device_init_wakeup(max14577->dev, false);
 	mfd_remove_devices(max14577->dev);
 	regmap_del_irq_chip(max14577->irq, max14577->irq_data);
 	if (max14577->dev_type == MAXIM_DEVICE_TYPE_MAX77836)

-- 
2.45.2
Re: [PATCH 3/8] mfd: max14577: Fix wakeup source leaks on device unbind
Posted by Lee Jones 10 months ago
On Sun, 06 Apr 2025, Krzysztof Kozlowski wrote:

> 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/max14577.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
> index 6fce79ec2dc64682ef4d85f22d762ec8e2ce1adb..7e7e8af9af224660557e76c2b80d92b05c86d202 100644
> --- a/drivers/mfd/max14577.c
> +++ b/drivers/mfd/max14577.c
> @@ -456,6 +456,7 @@ static void max14577_i2c_remove(struct i2c_client *i2c)
>  {
>  	struct max14577 *max14577 = i2c_get_clientdata(i2c);
>  
> +	device_init_wakeup(max14577->dev, false);

devm_* again?

>  	mfd_remove_devices(max14577->dev);
>  	regmap_del_irq_chip(max14577->irq, max14577->irq_data);
>  	if (max14577->dev_type == MAXIM_DEVICE_TYPE_MAX77836)
> 
> -- 
> 2.45.2
> 

-- 
Lee Jones [李琼斯]