linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: tegra: match return type of wait_for_completion_timeout
@ 2015-03-01 14:17 Nicholas Mc Guire
  2015-03-03  7:36 ` Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas Mc Guire @ 2015-03-01 14:17 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: Wolfram Sang, Stephen Warren, Thierry Reding, Alexandre Courbot,
	linux-i2c, linux-tegra, linux-kernel, Nicholas Mc Guire

return type of wait_for_completion_timeout is unsigned long not int. As ret
was only used for wait_for_completion_timeout here it is renamed to time_left
the type changed to unsigned long and references fixed up.

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

This patch was only compile tested with tegra_defconfig
(implies CONFIG_I2C_TEGRA=y)

Patch is against 4.0-rc1 (localversion-next is -next-20150227)

 drivers/i2c/busses/i2c-tegra.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 29f1433..1bcd75e 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -532,7 +532,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
 {
 	u32 packet_header;
 	u32 int_mask;
-	int ret;
+	unsigned long time_left;
 
 	tegra_i2c_flush_fifos(i2c_dev);
 
@@ -585,18 +585,20 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
 	dev_dbg(i2c_dev->dev, "unmasked irq: %02x\n",
 		i2c_readl(i2c_dev, I2C_INT_MASK));
 
-	ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT);
+	time_left = wait_for_completion_timeout(&i2c_dev->msg_complete,
+						TEGRA_I2C_TIMEOUT);
 	tegra_i2c_mask_irq(i2c_dev, int_mask);
 
-	if (ret == 0) {
+	if (time_left == 0) {
 		dev_err(i2c_dev->dev, "i2c transfer timed out\n");
 
 		tegra_i2c_init(i2c_dev);
 		return -ETIMEDOUT;
 	}
 
-	dev_dbg(i2c_dev->dev, "transfer complete: %d %d %d\n",
-		ret, completion_done(&i2c_dev->msg_complete), i2c_dev->msg_err);
+	dev_dbg(i2c_dev->dev, "transfer complete: %lu %d %d\n",
+		time_left, completion_done(&i2c_dev->msg_complete),
+		i2c_dev->msg_err);
 
 	if (likely(i2c_dev->msg_err == I2C_ERR_NONE))
 		return 0;
-- 
1.7.10.4


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

* Re: [PATCH] i2c: tegra: match return type of wait_for_completion_timeout
  2015-03-01 14:17 [PATCH] i2c: tegra: match return type of wait_for_completion_timeout Nicholas Mc Guire
@ 2015-03-03  7:36 ` Alexandre Courbot
  2015-03-11  9:23 ` Thierry Reding
  2015-03-15  9:17 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2015-03-03  7:36 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Laxman Dewangan, Wolfram Sang, Stephen Warren, Thierry Reding,
	linux-i2c, linux-tegra, Linux Kernel Mailing List

On Sun, Mar 1, 2015 at 11:17 PM, Nicholas Mc Guire <hofrat@osadl.org> wrote:
> return type of wait_for_completion_timeout is unsigned long not int. As ret
> was only used for wait_for_completion_timeout here it is renamed to time_left
> the type changed to unsigned long and references fixed up.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Looks good!

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

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

* Re: [PATCH] i2c: tegra: match return type of wait_for_completion_timeout
  2015-03-01 14:17 [PATCH] i2c: tegra: match return type of wait_for_completion_timeout Nicholas Mc Guire
  2015-03-03  7:36 ` Alexandre Courbot
@ 2015-03-11  9:23 ` Thierry Reding
  2015-03-15  9:17 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2015-03-11  9:23 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Laxman Dewangan, Wolfram Sang, Stephen Warren, Alexandre Courbot,
	linux-i2c, linux-tegra, linux-kernel

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

On Sun, Mar 01, 2015 at 09:17:41AM -0500, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. As ret
> was only used for wait_for_completion_timeout here it is renamed to time_left
> the type changed to unsigned long and references fixed up.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> This patch was only compile tested with tegra_defconfig
> (implies CONFIG_I2C_TEGRA=y)
> 
> Patch is against 4.0-rc1 (localversion-next is -next-20150227)
> 
>  drivers/i2c/busses/i2c-tegra.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

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

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

* Re: [PATCH] i2c: tegra: match return type of wait_for_completion_timeout
  2015-03-01 14:17 [PATCH] i2c: tegra: match return type of wait_for_completion_timeout Nicholas Mc Guire
  2015-03-03  7:36 ` Alexandre Courbot
  2015-03-11  9:23 ` Thierry Reding
@ 2015-03-15  9:17 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-03-15  9:17 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Laxman Dewangan, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-i2c, linux-tegra, linux-kernel

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

On Sun, Mar 01, 2015 at 09:17:41AM -0500, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. As ret
> was only used for wait_for_completion_timeout here it is renamed to time_left
> the type changed to unsigned long and references 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-01 14:17 [PATCH] i2c: tegra: match return type of wait_for_completion_timeout Nicholas Mc Guire
2015-03-03  7:36 ` Alexandre Courbot
2015-03-11  9:23 ` Thierry Reding
2015-03-15  9:17 ` 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).