summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen2012-05-12 15:39:34 +0200
committerGreg Kroah-Hartman2012-05-14 22:39:19 +0200
commit8fa2c315077787356bb7417d63e5a87b85f296a0 (patch)
treeaaacd85eb2409a8fab3c5aefd2e5c9d9b5958d35 /drivers/staging/iio
parentiio: Use dev_to_iio_dev() (diff)
downloadkernel-qcow2-linux-8fa2c315077787356bb7417d63e5a87b85f296a0.tar.gz
kernel-qcow2-linux-8fa2c315077787356bb7417d63e5a87b85f296a0.tar.xz
kernel-qcow2-linux-8fa2c315077787356bb7417d63e5a87b85f296a0.zip
staging:iio:adis16203_read_ring_data: Pass IIO device directly
When calling adis16203_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/accel/adis16203_ring.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/iio/accel/adis16203_ring.c b/drivers/staging/iio/accel/adis16203_ring.c
index 2171f7483e71..7bbd2c2bbd19 100644
--- a/drivers/staging/iio/accel/adis16203_ring.c
+++ b/drivers/staging/iio/accel/adis16203_ring.c
@@ -12,13 +12,12 @@
/**
* adis16203_read_ring_data() read data registers which will be placed into ring
- * @dev: device associated with child of actual device (iio_dev or iio_trig)
+ * @indio_dev: the IIO device
* @rx: somewhere to pass back the value read
**/
-static int adis16203_read_ring_data(struct device *dev, u8 *rx)
+static int adis16203_read_ring_data(struct iio_dev *indio_dev, u8 *rx)
{
struct spi_message msg;
- struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct adis16203_state *st = iio_priv(indio_dev);
struct spi_transfer xfers[ADIS16203_OUTPUTS + 1];
int ret;
@@ -74,7 +73,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
}
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
- adis16203_read_ring_data(&indio_dev->dev, st->rx) >= 0)
+ adis16203_read_ring_data(indio_dev, st->rx) >= 0)
for (; i < bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength); i++)
data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2]));