]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: (adt7410) Clear unwanted bits in the config register
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 15 Feb 2013 16:57:10 +0000 (17:57 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 15 Feb 2013 20:01:18 +0000 (12:01 -0800)
Make sure to clear the mode bits from the config register before setting the new
mode. Otherwise we might end up with a different mode than we want to.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/adt7410.c

index 797c2b85c483623bd173bda287bd8aadf6903ea5..4ccee4fbfd73176ff3951897d83da683e8d9cc4c 100644 (file)
@@ -364,6 +364,7 @@ static int adt7410_probe(struct i2c_client *client,
        /*
         * Set to 16 bit resolution, continous conversion and comparator mode.
         */
+       ret &= ~ADT7410_MODE_MASK;
        data->config = ret | ADT7410_FULL | ADT7410_RESOLUTION |
                        ADT7410_EVENT_MODE;
        if (data->config != data->oldconfig) {