]> git.sur5r.net Git - groeck-nct6775/commitdiff
Used bits in temp_mask start with 1
authorGuenter Roeck <linux@roeck-us.net>
Sat, 20 May 2017 19:53:41 +0000 (12:53 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 20 May 2017 19:53:41 +0000 (12:53 -0700)
Used bits in temperature source registers, and thus temp_mask, start with 1.
Valid sources in reg_temp_alternate[] start with 0. Add missing offset.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
nct6775.c

index a8ae8dac51eb31f577002f9a4e7df2514b1a71d0..5f448f320982409e1315f4c57307d0fadae514d4 100644 (file)
--- a/nct6775.c
+++ b/nct6775.c
@@ -4126,7 +4126,7 @@ static int nct6775_probe(struct platform_device *pdev)
         * is set.
         */
        for (i = 0; i < 32; i++) {
-               if (!(data->temp_mask & BIT(i)))
+               if (!(data->temp_mask & BIT(i + 1)))
                        continue;
                if (!reg_temp_alternate[i])
                        continue;