iio:trigger: Add helper function to verify that a trigger belongs to the same device
Some triggers can only be attached to the IIO device that corresponds to the same physical device. Currently each driver that requires this implements its own trigger validation function. Introduce a new helper function called iio_trigger_validate_own_device() that can be used to do this check. Having a common implementation avoids code duplication and unnecessary boiler-plate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:

committed by
Jonathan Cameron

parent
38e442fc8b
commit
43ece27e70
@@ -170,6 +170,8 @@ void iio_trigger_free(struct iio_trigger *trig);
|
||||
*/
|
||||
bool iio_trigger_using_own(struct iio_dev *indio_dev);
|
||||
|
||||
int iio_trigger_validate_own_device(struct iio_trigger *trig,
|
||||
struct iio_dev *indio_dev);
|
||||
|
||||
#else
|
||||
struct iio_trigger;
|
||||
|
Reference in New Issue
Block a user