staging:iio:adis16209_read_ring_data: Pass IIO device directly
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 12 May 2012 13:39:36 +0000 (15:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2012 20:39:19 +0000 (13:39 -0700)
When calling adis16209_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>
drivers/staging/iio/accel/adis16209_ring.c

index f7ed989dd20cb834102b81c8f7c6c97675f9d2a4..090607504c937ebeba25731a3eb2af8212f84805 100644 (file)
 
 /**
  * adis16209_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 adis16209_read_ring_data(struct device *dev, u8 *rx)
+static int adis16209_read_ring_data(struct iio_dev *indio_dev, u8 *rx)
 {
        struct spi_message msg;
-       struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct adis16209_state *st = iio_priv(indio_dev);
        struct spi_transfer xfers[ADIS16209_OUTPUTS + 1];
        int ret;
@@ -71,7 +70,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
        }
 
        if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
-           adis16209_read_ring_data(&indio_dev->dev, st->rx) >= 0)
+           adis16209_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]));
This page took 0.025132 seconds and 5 git commands to generate.