diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-09-20 10:25:19 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-09-20 10:25:19 +0200 |
commit | 13b3c3fa27f8f4ed306ce624f446fab000dd8ee4 (patch) | |
tree | 47c700d617d4a340bfc77b96efeff9a23228e2ff /drivers/hwmon/atxp1.c | |
parent | 9824b8f11373b0df806c135a342da9319ef1d893 (diff) | |
download | lwn-13b3c3fa27f8f4ed306ce624f446fab000dd8ee4.tar.gz lwn-13b3c3fa27f8f4ed306ce624f446fab000dd8ee4.zip |
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: Jean Delvare <khali@linux-fr.org>
Acked-by: Sebastian Witt <se.witt@gmx.net>
Diffstat (limited to 'drivers/hwmon/atxp1.c')
-rw-r--r-- | drivers/hwmon/atxp1.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index d191118ba0cb..d6b490d3e36f 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c @@ -31,7 +31,7 @@ MODULE_LICENSE("GPL"); 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>"); #define ATXP1_VID 0x00 @@ -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) && (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, 0xff) == 0) )) { + (i2c_smbus_read_byte_data(new_client, 0xff) == 0))) + return -ENODEV; - /* No vendor ID, now checking if registers 0x10,0x11 (non-existent) - * showing the same as register 0x00 */ - temp = i2c_smbus_read_byte_data(new_client, 0x00); + /* No vendor ID, now checking if registers 0x10,0x11 (non-existent) + * showing the same as register 0x00 */ + temp = i2c_smbus_read_byte_data(new_client, 0x00); - if (!((i2c_smbus_read_byte_data(new_client, 0x10) == temp) && - (i2c_smbus_read_byte_data(new_client, 0x11) == temp) )) - return -ENODEV; - } + if (!((i2c_smbus_read_byte_data(new_client, 0x10) == temp) && + (i2c_smbus_read_byte_data(new_client, 0x11) == temp))) + return -ENODEV; /* Get VRM */ temp = vid_which_vrm(); |