提交 fe5adb91 编写于 作者: H Hartmut Knaack 提交者: Jonathan Cameron

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: 8592a7ee ("iio: ltr501: Add support for ltr559 chip")
Signed-off-by: NHartmut Knaack <knaack.h@gmx.de>
Acked-by: NDaniel Baluta <daniel.baluta@intel.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 0d1462de
......@@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data)
if (ret < 0)
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);
if (ret < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册