hwmon: (lm95241) Fix chip detection code
PATCH v2 1/3 hwmon: (lm95241) Fix chip detection code
The LM95241 driver accepts every chip ID equal to or larger than 0xA4 as its own, and other chips such as LM95245 use chip IDs in the accepted ID range. This results in false chip detection.
Fix problem by accepting only the known LM95241 chip ID.
Signed-off-by Guenter Roeck <[email protected]>
---
Candidate for -stable.
drivers/hwmon/lm95241.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/lm95241.c +1 -1
@@ -339,7 +339,7 @@ static int lm95241_detect(struct i2c_client *new_client,if ((i2c_smbus_read_byte_data (new_client,LM95241_REG_R_MAN_ID ) =MANUFACTURER_ID ) && (i2c_smbus_read_byte_data (new_client,LM95241_REG_R_CHIP_ID ) - >=DEFAULT_REVISION )) { + =DEFAULT_REVISION )) { name =DEVNAME ; }else { dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n",
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2 1/3] hwmon: (lm95241) Fix chip detection
Quoted 7 lines · Guenter Roeck
The LM95241 driver accepts every chip ID equal to or larger than
0xA4as its own, and other chips such as LM95245 use chip IDs in the accepted ID range. This results in false chip detection.Fix problem by accepting only the known LM95241 chip ID.
Signed-off-by Guenter Roeck <[email protected]>
Acked-by Jean Delvare <[email protected]>
Quoted 2 lines
---
Candidate for -stable.
Definitely.
Quoted 17 lines
drivers/hwmon/lm95241.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/hwmon/lm95241.c +1
-1@@ -339,7 +339,7 @@ static int lm95241_detect(struct i2c_client *new_client,if ((i2c_smbus_read_byte_data (new_client,LM95241_REG_R_MAN_ID ) =MANUFACTURER_ID ) && (i2c_smbus_read_byte_data (new_client,LM95241_REG_R_CHIP_ID ) - >=DEFAULT_REVISION )) { + =DEFAULT_REVISION )) { name =DEVNAME ; }else { dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n",
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors