From 41327efd212f93683f6f107e33bc7e4cb8e6be42 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 9 May 2013 10:36:20 -0700 Subject: [PATCH] Do not assign non-existing over-temperature and hysteresis registers Overtemperature and hysteresis registers only exist for primary temperature registers, not for alternates. Signed-off-by: Guenter Roeck --- nct6775.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nct6775.c b/nct6775.c index 1e4cd38..adace14 100644 --- 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; } -- 2.39.5