Commit 2a20af72 authored by Sandhya Bankar's avatar Sandhya Bankar Committed by Jonathan Cameron

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: default avatarSandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent aa16c6bd
...@@ -204,17 +204,18 @@ static int max44000_write_alspga(struct max44000_data *data, int val) ...@@ -204,17 +204,18 @@ static int max44000_write_alspga(struct max44000_data *data, int val)
static int max44000_read_alsval(struct max44000_data *data) static int max44000_read_alsval(struct max44000_data *data)
{ {
u16 regval; u16 regval;
__be16 val;
int alstim, ret; int alstim, ret;
ret = regmap_bulk_read(data->regmap, MAX44000_REG_ALS_DATA_HI, ret = regmap_bulk_read(data->regmap, MAX44000_REG_ALS_DATA_HI,
&regval, sizeof(regval)); &val, sizeof(val));
if (ret < 0) if (ret < 0)
return ret; return ret;
alstim = ret = max44000_read_alstim(data); alstim = ret = max44000_read_alstim(data);
if (ret < 0) if (ret < 0)
return ret; return ret;
regval = be16_to_cpu(regval); regval = be16_to_cpu(val);
/* /*
* Overflow is explained on datasheet page 17. * Overflow is explained on datasheet page 17.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment