Skip to content

Commit

Permalink
hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Guenter Roeck committed Aug 27, 2013
1 parent 60c1f31 commit a4bf06d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/adt7462.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int ADT7462_REG_VOLT_MAX(struct adt7462_data *data, int which)
return 0x4C;
break;
}
return -ENODEV;
return 0;
}

static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which)
Expand Down Expand Up @@ -392,7 +392,7 @@ static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which)
return 0x77;
break;
}
return -ENODEV;
return 0;
}

static int ADT7462_REG_VOLT(struct adt7462_data *data, int which)
Expand Down

0 comments on commit a4bf06d

Please sign in to comment.