linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iio: tsl4531: fix error handling in tsl4531_check_id()
@ 2015-08-13 20:21 Dan Carpenter
  2015-08-13 21:03 ` Dan Murphy
  2015-08-15 14:35 ` Jonathan Cameron
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Carpenter @ 2015-08-13 20:21 UTC (permalink / raw)
  To: Jonathan Cameron, Peter Meerwald
  Cc: Hartmut Knaack, Lars-Peter Clausen, Krzysztof Kozlowski,
	Dan Murphy, linux-iio, kernel-janitors

The caller expect us to return zero if the ID doesn't match.  Negative
error codes are treated as success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
index 2697918..730fd2b 100644
--- a/drivers/iio/light/tsl4531.c
+++ b/drivers/iio/light/tsl4531.c
@@ -151,7 +151,7 @@ static int tsl4531_check_id(struct i2c_client *client)
 {
 	int ret = i2c_smbus_read_byte_data(client, TSL4531_ID);
 	if (ret < 0)
-		return ret;
+		return 0;
 
 	switch (ret >> TSL4531_ID_SHIFT) {
 	case TSL45311_ID:

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

end of thread, other threads:[~2015-08-31 15:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 20:21 [patch] iio: tsl4531: fix error handling in tsl4531_check_id() Dan Carpenter
2015-08-13 21:03 ` Dan Murphy
2015-08-15 14:36   ` Jonathan Cameron
2015-08-15 14:35 ` Jonathan Cameron
2015-08-17 14:38   ` [patch v2] " Dan Carpenter
2015-08-17 14:51     ` Peter Meerwald
2015-08-17 15:05     ` Dan Murphy
2015-08-18  9:16       ` [patch v3] " Dan Carpenter
2015-08-31 15:30         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).