summaryrefslogtreecommitdiff
path: root/include/linux/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-09-23 18:19:41 +0300
committerJonathan Cameron <jic23@kernel.org>2016-09-27 22:32:55 +0300
commit43ece27e70b2c756e45306791955507f0533e248 (patch)
tree00290483da0ec9100df02fb4a65f04ea47170212 /include/linux/iio
parent38e442fc8ba11b32e57f4837e1aa695f3751b99c (diff)
downloadlinux-43ece27e70b2c756e45306791955507f0533e248.tar.xz
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>
Diffstat (limited to 'include/linux/iio')
-rw-r--r--include/linux/iio/trigger.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index 4f1154f7a33c..ea08302f2d7b 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -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;