summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandhya Bankar <bankarsandhya512@gmail.com>2016-09-24 21:44:55 +0530
committerJonathan Cameron <jic23@kernel.org>2016-09-27 20:33:01 +0100
commit2a20af722dde611b6b060af18dff651a8db96073 (patch)
treebe5ab824b4af720d84a108bc31edbf16956858fa
parentaa16c6bd0e09dc043b6ea200f729c8c440d40b57 (diff)
downloadlinux-2a20af722dde611b6b060af18dff651a8db96073.tar.gz
linux-2a20af722dde611b6b060af18dff651a8db96073.tar.bz2
linux-2a20af722dde611b6b060af18dff651a8db96073.zip
drivers: iio: light: Fix sparse warnings
Fixing below warnings: drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16 drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16 drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16 drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16 Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/light/max44000.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c
index 6511b20a2a29..a144ca3461fc 100644
--- a/drivers/iio/light/max44000.c
+++ b/drivers/iio/light/max44000.c
@@ -204,17 +204,18 @@ static int max44000_write_alspga(struct max44000_data *data, int val)
static int max44000_read_alsval(struct max44000_data *data)
{
u16 regval;
+ __be16 val;
int alstim, ret;
ret = regmap_bulk_read(data->regmap, MAX44000_REG_ALS_DATA_HI,
- &regval, sizeof(regval));
+ &val, sizeof(val));
if (ret < 0)
return ret;
alstim = ret = max44000_read_alstim(data);
if (ret < 0)
return ret;
- regval = be16_to_cpu(regval);
+ regval = be16_to_cpu(val);
/*
* Overflow is explained on datasheet page 17.