From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
Date: Tue, 8 Apr 2025 09:05:24 +0200 [thread overview]
Message-ID: <Z_TKtP_5S99Nakrs@lore-desk> (raw)
In-Reply-To: <20250406-b4-device-wakeup-leak-iio-v1-3-2d7d322a4a93@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1117 bytes --]
> Device can be unbound, so driver must also release memory for the wakeup
> source.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index 4fdcc2acc94ed0f594116b9141ce85f7c4449a58..96c6106b95eef60b43eb41fef67889d44d5836db 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -2719,8 +2719,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
> }
>
> if (device_property_read_bool(dev, "wakeup-source") ||
> - (pdata && pdata->wakeup_source))
> - device_init_wakeup(dev, true);
> + (pdata && pdata->wakeup_source)) {
> + err = devm_device_init_wakeup(dev);
> + if (err)
> + return dev_err_probe(dev, err, "Failed to init wakeup\n");
> + }
>
> return 0;
> }
>
> --
> 2.45.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-04-08 7:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-06 20:01 [PATCH 0/3] iio: Fix wakeup source leaks on device unbind Krzysztof Kozlowski
2025-04-06 20:01 ` [PATCH 1/3] iio: accel: fxls8962af: " Krzysztof Kozlowski
2025-04-06 20:01 ` [PATCH 2/3] iio: adc: qcom-spmi-iadc: " Krzysztof Kozlowski
2025-04-06 20:01 ` [PATCH 3/3] iio: imu: st_lsm6dsx: " Krzysztof Kozlowski
2025-04-08 7:05 ` Lorenzo Bianconi [this message]
2025-04-12 11:24 ` [PATCH 0/3] iio: " Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z_TKtP_5S99Nakrs@lore-desk \
--to=lorenzo@kernel.org \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.