mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-26 06:23:09 -05:00
iio: accel: fxls8962af: 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> Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-1-2d7d322a4a93@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
2d7b60f33d
commit
0cd34d98df
@@ -1226,8 +1226,11 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (device_property_read_bool(dev, "wakeup-source"))
|
||||
device_init_wakeup(dev, true);
|
||||
if (device_property_read_bool(dev, "wakeup-source")) {
|
||||
ret = devm_device_init_wakeup(dev);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to init wakeup\n");
|
||||
}
|
||||
|
||||
return devm_iio_device_register(dev, indio_dev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user