summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>2016-03-23 12:06:34 +0100
committerJonathan Cameron <jic23@kernel.org>2016-04-03 10:27:50 +0100
commit6154a108faafe5f7fe08cee933b899b013b457d9 (patch)
treec5903266c29b2e04cb2c7c41c81d40d828caa9e1 /drivers/staging/iio
parent8cb359e3a1f6318f971bec281623613f48b711be (diff)
Staging: iio: ad7606: Fix sparse endian warning
Fix following sparse warning: warning: cast to restricted __be16 Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/adc/ad7606_spi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
index d873a5164595..825da0769936 100644
--- a/drivers/staging/iio/adc/ad7606_spi.c
+++ b/drivers/staging/iio/adc/ad7606_spi.c
@@ -21,7 +21,8 @@ static int ad7606_spi_read_block(struct device *dev,
{
struct spi_device *spi = to_spi_device(dev);
int i, ret;
- unsigned short *data = buf;
+ unsigned short *data;
+ __be16 *bdata = buf;
ret = spi_read(spi, buf, count * 2);
if (ret < 0) {
@@ -30,7 +31,7 @@ static int ad7606_spi_read_block(struct device *dev,
}
for (i = 0; i < count; i++)
- data[i] = be16_to_cpu(data[i]);
+ data[i] = be16_to_cpu(bdata[i]);
return 0;
}