Skip to content

Commit 74cb215

Browse files
JPSGoncalvesjic23
authored andcommitted
iio: trigger: Fix condition for own trigger
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: 517985e ("iio: trigger: Add simple trigger_validation helper") Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/20240614143658.3531097-1-jpaulo.silvagoncalves@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 8fe050e commit 74cb215

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/industrialio-trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ int iio_trigger_attach_poll_func(struct iio_trigger *trig,
315315
* this is the case if the IIO device and the trigger device share the
316316
* same parent device.
317317
*/
318-
if (iio_validate_own_trigger(pf->indio_dev, trig))
318+
if (!iio_validate_own_trigger(pf->indio_dev, trig))
319319
trig->attached_own_device = true;
320320

321321
return ret;

0 commit comments

Comments
 (0)