diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-08-14 05:45:26 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-08-27 11:28:01 -0400 |
commit | a4bf06d58f219230ee38e338fdda225973d44aa1 (patch) | |
tree | c4433d0a08a5dfa93dcb4bfdcf666f7ea5f7d5f3 /drivers/hwmon/adt7462.c | |
parent | 60c1f31fc5dfdbef388f47739e14c3cd85ad17e2 (diff) |
hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0
The callers never check for negative but they sometimes check for zero
returns:
int reg = ADT7462_REG_VOLT_MAX(data, i);
data->volt_max[i] =
(reg ? i2c_smbus_read_byte_data(client, reg) : 0);
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/adt7462.c')
-rw-r--r-- | drivers/hwmon/adt7462.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c index 69481d3a3d23..3e6aba12e46a 100644 --- a/drivers/hwmon/adt7462.c +++ b/drivers/hwmon/adt7462.c | |||
@@ -333,7 +333,7 @@ static int ADT7462_REG_VOLT_MAX(struct adt7462_data *data, int which) | |||
333 | return 0x4C; | 333 | return 0x4C; |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | return -ENODEV; | 336 | return 0; |
337 | } | 337 | } |
338 | 338 | ||
339 | static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which) | 339 | static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which) |
@@ -392,7 +392,7 @@ static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which) | |||
392 | return 0x77; | 392 | return 0x77; |
393 | break; | 393 | break; |
394 | } | 394 | } |
395 | return -ENODEV; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||
398 | static int ADT7462_REG_VOLT(struct adt7462_data *data, int which) | 398 | static int ADT7462_REG_VOLT(struct adt7462_data *data, int which) |