]> git.sur5r.net Git - groeck-nct6775/commitdiff
Do not assign non-existing over-temperature and hysteresis registers nct6775-v1.0
authorGuenter Roeck <linux@roeck-us.net>
Thu, 9 May 2013 17:36:20 +0000 (10:36 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 9 May 2013 17:36:20 +0000 (10:36 -0700)
Overtemperature and hysteresis registers only exist for primary
temperature registers, not for alternates.

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

index 1e4cd38f4729181e5e7c453089b9849d8c160a46..adace14d6b08ea0f0537a845ee0d9c13fc43d892 100644 (file)
--- a/nct6775.c
+++ b/nct6775.c
@@ -3428,8 +3428,10 @@ static int nct6775_probe(struct platform_device *pdev)
                        data->have_temp |= 1 << i;
                        data->have_temp_fixed |= 1 << i;
                        data->reg_temp[0][i] = reg_temp_alternate[i];
-                       data->reg_temp[1][i] = reg_temp_over[i];
-                       data->reg_temp[2][i] = reg_temp_hyst[i];
+                       if (i < num_reg_temp) {
+                               data->reg_temp[1][i] = reg_temp_over[i];
+                               data->reg_temp[2][i] = reg_temp_hyst[i];
+                       }
                        data->temp_src[i] = i + 1;
                        continue;
                }