From: Jean Delvare Date: Fri, 17 Oct 2008 15:51:15 +0000 (+0200) Subject: hwmon: (lm78) Prevent misdetection of Winbond chips X-Git-Tag: firefly_0821_release~17367^2~21 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ad3273be8e2a5bfe16f4940beef3da308daf259a;p=firefly-linux-kernel-4.4.55.git hwmon: (lm78) Prevent misdetection of Winbond chips The LM78 detection is relatively weak, and sometimes recent Winbond chips can be misdetected as an LM78. We have had repeated reports of this happening. We have an explicit check against this for the ISA access, do the same for I2C access now. Signed-off-by: Jean Delvare --- diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index ec601bbf91b9..f284ecbb9ca8 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c @@ -613,6 +613,12 @@ static int lm78_detect(struct i2c_adapter *adapter, int address, int kind) err = -ENODEV; goto ERROR2; } + /* Explicitly prevent the misdetection of Winbond chips */ + i = lm78_read_value(data, 0x4f); + if (i == 0xa3 || i == 0x5c) { + err = -ENODEV; + goto ERROR2; + } } /* Determine the chip type. */