diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-07-11 15:39:10 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-22 18:38:28 (GMT) |
commit | c3db00cc80cf01f9a2033c3f3eb03345d0024761 (patch) | |
tree | cead6de24daaea7fe892461312bfe99040d77c75 /drivers/staging/iio/gyro/adis16260_ring.c | |
parent | 15744090c5ad3ed404a541bdec6f4f9ae1996fc9 (diff) | |
download | linux-fsl-qoriq-c3db00cc80cf01f9a2033c3f3eb03345d0024761.tar.xz |
staging: iio: Add iio_triggered_ring postenable and predisable + use in drivers
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/gyro/adis16260_ring.c')
-rw-r--r-- | drivers/staging/iio/gyro/adis16260_ring.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_ring.c b/drivers/staging/iio/gyro/adis16260_ring.c index bf3c2e8..05e7a69 100644 --- a/drivers/staging/iio/gyro/adis16260_ring.c +++ b/drivers/staging/iio/gyro/adis16260_ring.c @@ -179,22 +179,6 @@ static int adis16260_data_rdy_ring_preenable(struct iio_dev *indio_dev) return 0; } -static int adis16260_data_rdy_ring_postenable(struct iio_dev *indio_dev) -{ - return indio_dev->trig - ? iio_trigger_attach_poll_func(indio_dev->trig, - indio_dev->pollfunc) - : 0; -} - -static int adis16260_data_rdy_ring_predisable(struct iio_dev *indio_dev) -{ - return indio_dev->trig - ? iio_trigger_dettach_poll_func(indio_dev->trig, - indio_dev->pollfunc) - : 0; -} - void adis16260_unconfigure_ring(struct iio_dev *indio_dev) { kfree(indio_dev->pollfunc); @@ -227,8 +211,8 @@ int adis16260_configure_ring(struct iio_dev *indio_dev) /* Effectively select the ring buffer implementation */ iio_ring_sw_register_funcs(&ring->access); ring->preenable = &adis16260_data_rdy_ring_preenable; - ring->postenable = &adis16260_data_rdy_ring_postenable; - ring->predisable = &adis16260_data_rdy_ring_predisable; + ring->postenable = &iio_triggered_ring_postenable; + ring->predisable = &iio_triggered_ring_predisable; ring->owner = THIS_MODULE; ret = iio_alloc_pollfunc(indio_dev, NULL, &adis16260_poll_func_th); |