diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-10-24 11:47:42 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-10-30 02:36:03 +0100 |
commit | 5813da157f7dbe03d268c8d0dd9425d0e3944910 (patch) | |
tree | f4b6901727e4c5bfcd6af64b9dd77e185667d00b /drivers/hwmon | |
parent | hwmon: (asc7621) remove redundant assignment to newval (diff) | |
download | linux-5813da157f7dbe03d268c8d0dd9425d0e3944910.tar.xz linux-5813da157f7dbe03d268c8d0dd9425d0e3944910.zip |
hwmon: (max6621) Inverted if condition in max6621_read()
We intended to test for failure here but accidentally tested for
success. It means that we don't set "*val" to true and it means that
if i2c_smbus_write_byte() does fail then we return success.
Fixes: e7895864b0d7 ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/max6621.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/max6621.c b/drivers/hwmon/max6621.c index 22079ec29660..35555f0eefb9 100644 --- a/drivers/hwmon/max6621.c +++ b/drivers/hwmon/max6621.c @@ -296,7 +296,7 @@ max6621_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, if (regval) { ret = i2c_smbus_write_byte(data->client, MAX6621_CLEAR_ALERT_REG); - if (!ret) + if (ret) return ret; } |