diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2016-09-23 17:19:43 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-09-27 20:33:00 +0100 |
commit | bea15d5139b9eef3ca368b95c4dbd6621bff9a5c (patch) | |
tree | 68667378339b4344141589d7de8d9ed55442e176 /drivers/iio/adc | |
parent | 19808e0467a05ee4a3008f9d586ce32d5b34aba8 (diff) | |
download | linux-bea15d5139b9eef3ca368b95c4dbd6621bff9a5c.tar.gz linux-bea15d5139b9eef3ca368b95c4dbd6621bff9a5c.tar.bz2 linux-bea15d5139b9eef3ca368b95c4dbd6621bff9a5c.zip |
iio:max1027: Use iio_trigger_validate_own_device() helper
Use the new iio_trigger_validate_own_device() to verify that the trigger
can only be attached to the matching IIO device rather than using a custom
variant.
While the implementation of iio_trigger_validate_own_device() and the
custom variant and are not identical their behaviour is.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/max1027.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index d60181822833..3b7c4f78f37a 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -362,17 +362,6 @@ static int max1027_set_trigger_state(struct iio_trigger *trig, bool state) return 0; } -static int max1027_validate_device(struct iio_trigger *trig, - struct iio_dev *indio_dev) -{ - struct iio_dev *indio = iio_trigger_get_drvdata(trig); - - if (indio != indio_dev) - return -EINVAL; - - return 0; -} - static irqreturn_t max1027_trigger_handler(int irq, void *private) { struct iio_poll_func *pf = (struct iio_poll_func *)private; @@ -393,7 +382,7 @@ static irqreturn_t max1027_trigger_handler(int irq, void *private) static const struct iio_trigger_ops max1027_trigger_ops = { .owner = THIS_MODULE, - .validate_device = &max1027_validate_device, + .validate_device = &iio_trigger_validate_own_device, .set_trigger_state = &max1027_set_trigger_state, }; |