From: Hartmut Knaack Date: Sun, 28 Jun 2015 10:31:53 +0000 (+0200) Subject: iio:light:ltr501: fix variable in ltr501_init X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5919a0839bd65252f7306a0ee4879e697e00cab1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: 8592a7eefa540 ("iio: ltr501: Add support for ltr559 chip") Signed-off-by: Hartmut Knaack Acked-by: Daniel Baluta Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 1ef7d3773ab9..b5a0e66b5f28 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -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)