From: Guenter Roeck Date: Thu, 9 May 2013 17:36:20 +0000 (-0700) Subject: Do not assign non-existing over-temperature and hysteresis registers X-Git-Tag: nct6775-v1.0^0 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=41327efd212f93683f6f107e33bc7e4cb8e6be42;p=groeck-nct6775 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 --- 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; }