summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-06-18 00:31:59 +0200
committerJonathan Cameron <jic23@kernel.org>2015-07-19 11:48:08 +0100
commitbd7bd0cc3a60e082b17a4f64ce76831aa1c6dffe (patch)
tree722f46cfddb39852c57edc9d2e10f2c68cedb83d /drivers/iio/light
parent815983e9afcb21552e1b9d77e3755d394cbf5249 (diff)
downloadblackbird-op-linux-bd7bd0cc3a60e082b17a4f64ce76831aa1c6dffe.tar.gz
blackbird-op-linux-bd7bd0cc3a60e082b17a4f64ce76831aa1c6dffe.zip
iio:light:cm3323: clear bitmask before set
When setting the bits for integration time, the appropriate bitmask needs to be cleared first. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/cm3323.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/light/cm3323.c b/drivers/iio/light/cm3323.c
index 869033e48a1f..a1d4905cc9d2 100644
--- a/drivers/iio/light/cm3323.c
+++ b/drivers/iio/light/cm3323.c
@@ -123,7 +123,7 @@ static int cm3323_set_it_bits(struct cm3323_data *data, int val, int val2)
for (i = 0; i < ARRAY_SIZE(cm3323_int_time); i++) {
if (val == cm3323_int_time[i].val &&
val2 == cm3323_int_time[i].val2) {
- reg_conf = data->reg_conf;
+ reg_conf = data->reg_conf & ~CM3323_CONF_IT_MASK;
reg_conf |= i << CM3323_CONF_IT_SHIFT;
ret = i2c_smbus_write_word_data(data->client,
OpenPOWER on IntegriCloud