Commit 74cb2157 authored by João Paulo Gonçalves's avatar João Paulo Gonçalves Committed by Jonathan Cameron
Browse files

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: 517985eb ("iio: trigger: Add simple trigger_validation helper")
Signed-off-by: default avatarJoão Paulo Gonçalves <joao.goncalves@toradex.com>
Reviewed-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20240614143658.3531097-1-jpaulo.silvagoncalves@gmail.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 8fe050e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;