提交 ce7ea56c 编写于 作者: L Lars-Peter Clausen 提交者: Greg Kroah-Hartman

staging:iio:adis16204_read_ring_data: Pass IIO device directly

When calling adis16204_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: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NJonathan Cameron <jic23@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8fa2c315
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
/** /**
* adis16204_read_ring_data() read data registers which will be placed into ring * adis16204_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 * @rx: somewhere to pass back the value read
**/ **/
static int adis16204_read_ring_data(struct device *dev, u8 *rx) static int adis16204_read_ring_data(struct iio_dev *indio_dev, u8 *rx)
{ {
struct spi_message msg; struct spi_message msg;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct adis16204_state *st = iio_priv(indio_dev); struct adis16204_state *st = iio_priv(indio_dev);
struct spi_transfer xfers[ADIS16204_OUTPUTS + 1]; struct spi_transfer xfers[ADIS16204_OUTPUTS + 1];
int ret; int ret;
...@@ -71,7 +70,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p) ...@@ -71,7 +70,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
adis16204_read_ring_data(&indio_dev->dev, st->rx) >= 0) adis16204_read_ring_data(indio_dev, st->rx) >= 0)
for (; i < bitmap_weight(indio_dev->active_scan_mask, for (; i < bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength); i++) indio_dev->masklength); i++)
data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2])); data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2]));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册