Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0"
authorJeremy Fertic <jeremyfertic@gmail.com>
Wed, 5 Dec 2018 01:49:00 +0000 (18:49 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 8 Dec 2018 11:15:54 +0000 (11:15 +0000)
This reverts commit 00426e99789357dbff7e719a092ce36a3ce49d94.

i2c_smbus_read_byte() returns 0 when a byte with the value 0 is read from
the device. This is a valid read so revert the check for 0.

Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/addac/adt7316-i2c.c

index ac91163656b557f3e114f8c708abf66269ab46b3..2d51bd425662c9b60648b8f11cdd211424d44342 100644 (file)
@@ -30,10 +30,6 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data)
        }
 
        ret = i2c_smbus_read_byte(client);
-
-       if (!ret)
-               return -EIO;
-
        if (ret < 0) {
                dev_err(&cl->dev, "I2C read error\n");
                return ret;