summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-06-28 12:31:53 +0200
committerJonathan Cameron <jic23@kernel.org>2015-07-05 14:09:54 +0100
commit5919a0839bd65252f7306a0ee4879e697e00cab1 (patch)
treec6c14d62646e30d7ba85b916fb94d52bf7854776 /drivers/iio
parent68958bd5ca748beba1251937d6f6561e70e97c14 (diff)
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 <knaack.h@gmx.de> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/ltr501.c2
1 files changed, 1 insertions, 1 deletions
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)