iio:light:ltr501: fix variable in ltr501_init

When filling data->als_contr, the register content read into status needs
to be used, instead of the return status value of regmap_read.

Fixes: 8592a7eefa ("iio: ltr501: Add support for ltr559 chip")

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Hartmut Knaack 2015-06-28 12:31:53 +02:00 committed by Jonathan Cameron
parent 0d1462de0b
commit fe5adb9174

View file

@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data)
if (ret < 0) if (ret < 0)
return ret; return ret;
data->als_contr = ret | data->chip_info->als_mode_active; data->als_contr = status | data->chip_info->als_mode_active;
ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status); ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status);
if (ret < 0) if (ret < 0)