diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2016-09-23 18:19:42 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-09-27 22:32:59 +0300 |
commit | 19808e0467a05ee4a3008f9d586ce32d5b34aba8 (patch) | |
tree | 5f1f1eecd15cac1e5e6fd6d57cf83bb092091030 /drivers | |
parent | 43ece27e70b2c756e45306791955507f0533e248 (diff) | |
download | linux-19808e0467a05ee4a3008f9d586ce32d5b34aba8.tar.xz |
iio:mma8452: Use new 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')
-rw-r--r-- | drivers/iio/accel/mma8452.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index d41e1b588e68..1c7051581513 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1347,20 +1347,9 @@ static int mma8452_data_rdy_trigger_set_state(struct iio_trigger *trig, return mma8452_change_config(data, MMA8452_CTRL_REG4, reg); } -static int mma8452_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 const struct iio_trigger_ops mma8452_trigger_ops = { .set_trigger_state = mma8452_data_rdy_trigger_set_state, - .validate_device = mma8452_validate_device, + .validate_device = iio_trigger_validate_own_device, .owner = THIS_MODULE, }; |