diff options
author | Hartmut Knaack <knaack.h@gmx.de> | 2015-06-28 12:31:53 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-07-19 11:48:16 +0100 |
commit | fe5adb917431aafe1324a2455634ed59147df807 (patch) | |
tree | 3a050e8aa415bf58e0ff5858566f33386ff4d02b /drivers/iio | |
parent | 0d1462de0b24fd09284411a3753f24a3d7c67577 (diff) | |
download | linux-stable-fe5adb917431aafe1324a2455634ed59147df807.tar.gz linux-stable-fe5adb917431aafe1324a2455634ed59147df807.tar.bz2 linux-stable-fe5adb917431aafe1324a2455634ed59147df807.zip |
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.c | 2 |
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) |