diff mbox series

[2/2] usb: typec: tipd: Fix wakeup source leaks on device unbind

Message ID 20250406204051.63446-2-krzysztof.kozlowski@linaro.org
State New
Headers show
Series [1/2] usb: typec: tcpci: Fix wakeup source leaks on device unbind | expand

Commit Message

Krzysztof Kozlowski April 6, 2025, 8:40 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/usb/typec/tipd/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heikki Krogerus April 7, 2025, 1:58 p.m. UTC | #1
On Sun, Apr 06, 2025 at 10:40:51PM +0200, 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>

The same comment here - this should be tagged as a fix.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tipd/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 7ee721a877c1..dcf141ada078 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c
> @@ -1431,7 +1431,7 @@ static int tps6598x_probe(struct i2c_client *client)
>  
>  	tps->wakeup = device_property_read_bool(tps->dev, "wakeup-source");
>  	if (tps->wakeup && client->irq) {
> -		device_init_wakeup(&client->dev, true);
> +		devm_device_init_wakeup(&client->dev);
>  		enable_irq_wake(client->irq);
>  	}
>  
> -- 
> 2.45.2
diff mbox series

Patch

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 7ee721a877c1..dcf141ada078 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1431,7 +1431,7 @@  static int tps6598x_probe(struct i2c_client *client)
 
 	tps->wakeup = device_property_read_bool(tps->dev, "wakeup-source");
 	if (tps->wakeup && client->irq) {
-		device_init_wakeup(&client->dev, true);
+		devm_device_init_wakeup(&client->dev);
 		enable_irq_wake(client->irq);
 	}