aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-05-12 09:39:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-14 16:39:20 -0400
commit48f29345cee22a4dfaf384ab3bbb8ba14f92b6a9 (patch)
tree5155db22921f7bd6678c0a98d0f5950e769d3f68 /drivers/staging/iio
parent8dc5afd8cb9b9a1253fdaa4e25d3ac1dccca6319 (diff)
staging:iio:adis16260_read_ring_data: Pass IIO device directly
When calling adis16260_read_ring_data we pass the device struct of embedded in the IIO device only to look up the IIO device from the device struct again right away. This patch changes the code to pass the IIO device directly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/gyro/adis16260_ring.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_ring.c b/drivers/staging/iio/gyro/adis16260_ring.c
index 25283376f2f..0fe2d9dfb6c 100644
--- a/drivers/staging/iio/gyro/adis16260_ring.c
+++ b/drivers/staging/iio/gyro/adis16260_ring.c
@@ -12,13 +12,12 @@
12 12
13/** 13/**
14 * adis16260_read_ring_data() read data registers which will be placed into ring 14 * adis16260_read_ring_data() read data registers which will be placed into ring
15 * @dev: device associated with child of actual device (iio_dev or iio_trig) 15 * @indio_dev: the IIO device
16 * @rx: somewhere to pass back the value read 16 * @rx: somewhere to pass back the value read
17 **/ 17 **/
18static int adis16260_read_ring_data(struct device *dev, u8 *rx) 18static int adis16260_read_ring_data(struct iio_dev *indio_dev, u8 *rx)
19{ 19{
20 struct spi_message msg; 20 struct spi_message msg;
21 struct iio_dev *indio_dev = dev_get_drvdata(dev);
22 struct adis16260_state *st = iio_priv(indio_dev); 21 struct adis16260_state *st = iio_priv(indio_dev);
23 struct spi_transfer xfers[ADIS16260_OUTPUTS + 1]; 22 struct spi_transfer xfers[ADIS16260_OUTPUTS + 1];
24 int ret; 23 int ret;
@@ -74,7 +73,7 @@ static irqreturn_t adis16260_trigger_handler(int irq, void *p)
74 } 73 }
75 74
76 if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && 75 if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
77 adis16260_read_ring_data(&indio_dev->dev, st->rx) >= 0) 76 adis16260_read_ring_data(indio_dev, st->rx) >= 0)
78 for (; i < bitmap_weight(indio_dev->active_scan_mask, 77 for (; i < bitmap_weight(indio_dev->active_scan_mask,
79 indio_dev->masklength); i++) 78 indio_dev->masklength); i++)
80 data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2])); 79 data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2]));