From 48f29345cee22a4dfaf384ab3bbb8ba14f92b6a9 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 12 May 2012 15:39:39 +0200 Subject: [PATCH] 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 Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/gyro/adis16260_ring.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/gyro/adis16260_ring.c b/drivers/staging/iio/gyro/adis16260_ring.c index 25283376f2fc..0fe2d9dfb6cd 100644 --- a/drivers/staging/iio/gyro/adis16260_ring.c +++ b/drivers/staging/iio/gyro/adis16260_ring.c @@ -12,13 +12,12 @@ /** * adis16260_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 adis16260_read_ring_data(struct device *dev, u8 *rx) +static int adis16260_read_ring_data(struct iio_dev *indio_dev, u8 *rx) { struct spi_message msg; - struct iio_dev *indio_dev = dev_get_drvdata(dev); struct adis16260_state *st = iio_priv(indio_dev); struct spi_transfer xfers[ADIS16260_OUTPUTS + 1]; int ret; @@ -74,7 +73,7 @@ static irqreturn_t adis16260_trigger_handler(int irq, void *p) } if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && - adis16260_read_ring_data(&indio_dev->dev, st->rx) >= 0) + adis16260_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])); -- 2.39.5