From: Matti Vaittinen <mazziesaccount@gmail.com>
To: "João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Lars-Peter Clausen" <lars@metafoo.de>
Cc: "João Paulo Gonçalves" <joao.goncalves@toradex.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] iio: trigger: Fix condition for own trigger
Date: Mon, 17 Jun 2024 09:13:53 +0300 [thread overview]
Message-ID: <4cb8af25-078c-45be-a544-653e2e2c6947@gmail.com> (raw)
In-Reply-To: <20240614143658.3531097-1-jpaulo.silvagoncalves@gmail.com>
On 6/14/24 17:36, João Paulo Gonçalves wrote:
> From: João Paulo Gonçalves <joao.goncalves@toradex.com>
>
> The condition for checking if triggers belong to the same IIO device to
> set attached_own_device is currently inverted, causing
> iio_trigger_using_own() to return an incorrect value. Fix it by testing
> for the correct return value of iio_validate_own_trigger().
>
> Cc: stable@vger.kernel.org
> Fixes: 517985ebc531 ("iio: trigger: Add simple trigger_validation helper")
> Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Thanks for fixing this!
> ---
> drivers/iio/industrialio-trigger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index 16de57846bd9..2e84776f4fbd 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -315,7 +315,7 @@ int iio_trigger_attach_poll_func(struct iio_trigger *trig,
> * this is the case if the IIO device and the trigger device share the
> * same parent device.
> */
> - if (iio_validate_own_trigger(pf->indio_dev, trig))
> + if (!iio_validate_own_trigger(pf->indio_dev, trig))
> trig->attached_own_device = true;
>
> return ret;
> --
> 2.34.1
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
prev parent reply other threads:[~2024-06-17 6:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 14:36 [PATCH] iio: trigger: Fix condition for own trigger João Paulo Gonçalves
2024-06-15 10:50 ` Jonathan Cameron
2024-06-16 9:38 ` Francesco Dolcini
2024-06-17 20:09 ` Jonathan Cameron
2024-06-17 6:13 ` Matti Vaittinen [this message]
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=4cb8af25-078c-45be-a544-653e2e2c6947@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=jic23@kernel.org \
--cc=joao.goncalves@toradex.com \
--cc=jpaulo.silvagoncalves@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox