Commit 13b3c3fa authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

hwmon: (atxp1) Fix device detection logic

The atxp1 device detection code has a major logic flaw, fix it. Not
sure how we managed to miss this when the driver was merged...
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarSebastian Witt <se.witt@gmx.net>
parent 9824b8f1
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("System voltages control via Attansic ATXP1"); MODULE_DESCRIPTION("System voltages control via Attansic ATXP1");
MODULE_VERSION("0.6.2"); MODULE_VERSION("0.6.3");
MODULE_AUTHOR("Sebastian Witt <se.witt@gmx.net>"); MODULE_AUTHOR("Sebastian Witt <se.witt@gmx.net>");
#define ATXP1_VID 0x00 #define ATXP1_VID 0x00
...@@ -289,16 +289,16 @@ static int atxp1_detect(struct i2c_client *new_client, int kind, ...@@ -289,16 +289,16 @@ static int atxp1_detect(struct i2c_client *new_client, int kind,
if (!((i2c_smbus_read_byte_data(new_client, 0x3e) == 0) && if (!((i2c_smbus_read_byte_data(new_client, 0x3e) == 0) &&
(i2c_smbus_read_byte_data(new_client, 0x3f) == 0) && (i2c_smbus_read_byte_data(new_client, 0x3f) == 0) &&
(i2c_smbus_read_byte_data(new_client, 0xfe) == 0) && (i2c_smbus_read_byte_data(new_client, 0xfe) == 0) &&
(i2c_smbus_read_byte_data(new_client, 0xff) == 0) )) { (i2c_smbus_read_byte_data(new_client, 0xff) == 0)))
return -ENODEV;
/* No vendor ID, now checking if registers 0x10,0x11 (non-existent) /* No vendor ID, now checking if registers 0x10,0x11 (non-existent)
* showing the same as register 0x00 */ * showing the same as register 0x00 */
temp = i2c_smbus_read_byte_data(new_client, 0x00); temp = i2c_smbus_read_byte_data(new_client, 0x00);
if (!((i2c_smbus_read_byte_data(new_client, 0x10) == temp) && if (!((i2c_smbus_read_byte_data(new_client, 0x10) == temp) &&
(i2c_smbus_read_byte_data(new_client, 0x11) == temp) )) (i2c_smbus_read_byte_data(new_client, 0x11) == temp)))
return -ENODEV; return -ENODEV;
}
/* Get VRM */ /* Get VRM */
temp = vid_which_vrm(); temp = vid_which_vrm();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment