public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0"
@ 2018-12-05  1:49 Jeremy Fertic
  2018-12-05 19:55 ` Shreeya Patel
  0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Fertic @ 2018-12-05  1:49 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: lars, Michael.Hennerich, knaack.h, pmeerw, gregkh, devel,
	linux-kernel, Jeremy Fertic

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>
---
 drivers/staging/iio/addac/adt7316-i2c.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c
index ac91163656b5..2d51bd425662 100644
--- a/drivers/staging/iio/addac/adt7316-i2c.c
+++ b/drivers/staging/iio/addac/adt7316-i2c.c
@@ -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;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-12-08 15:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-05  1:49 [PATCH] Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0" Jeremy Fertic
2018-12-05 19:55 ` Shreeya Patel
2018-12-05 21:59   ` Jeremy Fertic
2018-12-06 12:40     ` Dan Carpenter
2018-12-07 18:37       ` Shreeya Patel
2018-12-08 11:17         ` Jonathan Cameron
2018-12-08 15:33           ` Shreeya Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox