From: Guenter Roeck Date: Sat, 20 May 2017 19:53:41 +0000 (-0700) Subject: Used bits in temp_mask start with 1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5ccee02dbe31a626a88fff714e75b956447a2c07;p=groeck-nct6775 Used bits in temp_mask start with 1 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 --- diff --git a/nct6775.c b/nct6775.c index a8ae8da..5f448f3 100644 --- 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;