Skip to contentSkip to conversation

hwmon: (nct6775) Do not create non-existing attributes

PATCH New Guenter Roeck 1 participant 1 message May 9, 2013 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (nct6775) Do not create non-existing attributes

Overtemperature and hysteresis registers only exist for primary temperature registers, not for alternates, so do not assign those registers when initializing alternates.

---
 drivers/hwmon/nct6775.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/nct6775.c +4 -2
index 137c8ce..a27e625 100644
@@ -3427,8 +3427,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;
 		}
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors