hwmon: (lm95241) Fix chip detection code
authorGuenter Roeck <guenter.roeck@ericsson.com>
Mon, 27 Jun 2011 18:22:46 +0000 (11:22 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Sat, 9 Jul 2011 00:52:59 +0000 (17:52 -0700)
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 <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.30+
drivers/hwmon/lm95241.c

index 1a6dfb6df1e7ff121ce4903ab80f1b2e57ba2ef1..01c638e31e07ec0c985ef7ac1dd5a0a6b0697b1b 100644 (file)
@@ -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",