public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix i2c_pca_pf_waitforcompletion() return value
@ 2010-09-20  9:14 Yegor Yefremov
       [not found] ` <4C9725F8.1080200-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yegor Yefremov @ 2010-09-20  9:14 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, khali-PUYAD+kWke1g9hUCZPvPmw

ret is still -1, if during the polling read_byte() returns at once
with I2C_PCA_CON_SI set. So ret > 0 would lead 
i2c_pca_pf_waitforcompletion() to return 0, in spite of
the proper behavior. That's why only ret should be returned.

Signed-off-by: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

Index: b/drivers/i2c/busses/i2c-pca-platform.c
===================================================================
--- a/drivers/i2c/busses/i2c-pca-platform.c	2010-08-27 01:47:12.000000000 +0200
+++ b/drivers/i2c/busses/i2c-pca-platform.c	2010-09-20 10:21:05.000000000 +0200
@@ -96,7 +96,7 @@
 			udelay(100);
 	}
 
-	return ret > 0;
+	return ret;
 }
 
 static void i2c_pca_pf_dummyreset(void *pd)

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

end of thread, other threads:[~2010-09-22  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  9:14 [PATCH] fix i2c_pca_pf_waitforcompletion() return value Yegor Yefremov
     [not found] ` <4C9725F8.1080200-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-21  5:41   ` Wolfram Sang
     [not found]     ` <20100921054150.GA29281-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-09-21 13:59       ` Yegor Yefremov
     [not found]         ` <4C98BA51.3000209-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22  8:55           ` Yegor Yefremov
     [not found]             ` <4C99C479.7040902-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22  9:04               ` Wolfram Sang

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