summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/meter
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-05-12 15:39:40 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-14 13:39:20 -0700
commit2a0b871c4fee4405772428ac6178adce30c41abf (patch)
treeded5647b54b55407c9b1e988717c4a9ac03ee75f /drivers/staging/iio/meter
parent48f29345cee22a4dfaf384ab3bbb8ba14f92b6a9 (diff)
staging:iio:ade7758_spi_read_burst: Pass IIO device directly
When calling ade7758_spi_read_burst 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/meter')
-rw-r--r--drivers/staging/iio/meter/ade7758_ring.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
index 7b9be8a2cc50..92159f208d14 100644
--- a/drivers/staging/iio/meter/ade7758_ring.c
+++ b/drivers/staging/iio/meter/ade7758_ring.c
@@ -19,11 +19,10 @@
/**
* ade7758_spi_read_burst() - read data registers
- * @dev: device associated with child of actual device (iio_dev or iio_trig)
+ * @indio_dev: the IIO device
**/
-static int ade7758_spi_read_burst(struct device *dev)
+static int ade7758_spi_read_burst(struct iio_dev *indio_dev)
{
- struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7758_state *st = iio_priv(indio_dev);
int ret;
@@ -68,7 +67,7 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p)
u32 *dat32 = (u32 *)dat64;
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
- if (ade7758_spi_read_burst(&indio_dev->dev) >= 0)
+ if (ade7758_spi_read_burst(indio_dev) >= 0)
*dat32 = get_unaligned_be32(&st->rx_buf[5]) & 0xFFFFFF;
/* Guaranteed to be aligned with 8 byte boundary */