Re: [PATCH] hwmon: (max6621) Inverted if condition in max6621_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/2017 02:47 AM, Dan Carpenter wrote:
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@xxxxxxxxxx>

Applied to hwmon-next.

Thanks,
Guenter


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;
  			}
--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux