From: Krzysztof Kozlowski Date: Sun, 6 Apr 2025 20:40:50 +0000 (+0200) Subject: usb: typec: tcpci: Fix wakeup source leaks on device unbind X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9fc5986fbcd7e1e63afb04be94cd4e8a536a4b04;p=users%2Fjedix%2Flinux-maple.git usb: typec: tcpci: 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 Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20250406204051.63446-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/tcpm/tcpci_maxim_core.c b/drivers/usb/typec/tcpm/tcpci_maxim_core.c index fd1b805933676..29a4aa89d1a14 100644 --- a/drivers/usb/typec/tcpm/tcpci_maxim_core.c +++ b/drivers/usb/typec/tcpm/tcpci_maxim_core.c @@ -536,7 +536,10 @@ static int max_tcpci_probe(struct i2c_client *client) return dev_err_probe(&client->dev, ret, "IRQ initialization failed\n"); - device_init_wakeup(chip->dev, true); + ret = devm_device_init_wakeup(chip->dev); + if (ret) + return dev_err_probe(chip->dev, ret, "Failed to init wakeup\n"); + return 0; }