LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] i2c: mxs: match wait_for_completion_timeout return type
@ 2015-03-10 18:08 Nicholas Mc Guire
  2015-03-15  9:14 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-03-10 18:08 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Janusz Uzycki, Fabio Estevam, Marek Vasut, linux-i2c,
	linux-kernel, Nicholas Mc Guire

Return type of wait_for_completion_timeout is unsigned long not int. 
An appropriately named unsigned long is added and the assignment fixed up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Note that 4.0-rc3 does not compile for mxs_defcofnig due to a bug (typo)
in mxs-auart.c - the compile testing was done with the fixed up mxs-auart.

This was only compile tested for mxs_defconfig (implies CONFIG_I2C_MXS=y)

Patch is against 4.0-rc3 linux-next (localversion-next is -next-20150310)

 drivers/i2c/busses/i2c-mxs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index ff8b12c..56fceff 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -568,6 +568,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
 	int ret;
 	int flags;
 	int use_pio = 0;
+	unsigned long time_left;
 
 	flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0;
 
@@ -599,9 +600,9 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
 		if (ret)
 			return ret;
 
-		ret = wait_for_completion_timeout(&i2c->cmd_complete,
+		time_left = wait_for_completion_timeout(&i2c->cmd_complete,
 						msecs_to_jiffies(1000));
-		if (ret == 0)
+		if (!time_left)
 			goto timeout;
 
 		ret = i2c->cmd_err;
-- 
1.7.10.4


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

* Re: [PATCH] i2c: mxs: match wait_for_completion_timeout return type
  2015-03-10 18:08 [PATCH] i2c: mxs: match wait_for_completion_timeout return type Nicholas Mc Guire
@ 2015-03-15  9:14 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2015-03-15  9:14 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Janusz Uzycki, Fabio Estevam, Marek Vasut, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

On Tue, Mar 10, 2015 at 02:08:13PM -0400, Nicholas Mc Guire wrote:
> Return type of wait_for_completion_timeout is unsigned long not int. 
> An appropriately named unsigned long is added and the assignment fixed up.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Applied to for-next, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-03-15  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 18:08 [PATCH] i2c: mxs: match wait_for_completion_timeout return type Nicholas Mc Guire
2015-03-15  9:14 ` Wolfram Sang

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).