mfd: sprd-sc27xx: 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 <krzysztof.kozlowski@linaro.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250406-mfd-device-wakekup-leak-v1-8-318e14bdba0a@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
pull/1285/head
Krzysztof Kozlowski 2025-04-06 21:50:16 +02:00 committed by Lee Jones
parent 82ae581e56
commit 37ef4aa403
1 changed files with 4 additions and 1 deletions

View File

@ -210,7 +210,10 @@ static int sprd_pmic_probe(struct spi_device *spi)
return ret;
}
device_init_wakeup(&spi->dev, true);
ret = devm_device_init_wakeup(&spi->dev);
if (ret)
return dev_err_probe(&spi->dev, ret, "Failed to init wakeup\n");
return 0;
}