public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
@ 2010-09-27 10:55 Bernhard Walle
       [not found] ` <1285584916-21317-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Walle @ 2010-09-27 10:55 UTC (permalink / raw)
  To: khali-PUYAD+kWke1g9hUCZPvPmw
  Cc: ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8,
	rade.bozic.ext-OYasijW0DpE, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
afterwards. Since there's code in octeon_i2c_start() to handle the
error, it should be called.

Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
---
 drivers/i2c/busses/i2c-octeon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index 0e9f85d..56dbe54 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
 		return result;
 	} else if (result == 0) {
 		dev_dbg(i2c->dev, "%s: timeout\n", __func__);
-		result = -ETIMEDOUT;
+		return -ETIMEDOUT;
 	}
 
 	return 0;
-- 
1.7.0.4

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

* Re: [PATCH] MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
       [not found] ` <1285584916-21317-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
@ 2010-09-27 11:02   ` Wolfram Sang
  2010-09-27 17:32   ` David Daney
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2010-09-27 11:02 UTC (permalink / raw)
  To: Bernhard Walle
  Cc: khali-PUYAD+kWke1g9hUCZPvPmw,
	ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8,
	rade.bozic.ext-OYasijW0DpE, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ben Dooks

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

On Mon, Sep 27, 2010 at 12:55:16PM +0200, Bernhard Walle wrote:
> It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
> afterwards. Since there's code in octeon_i2c_start() to handle the
> error, it should be called.
> 
> Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>

Acked-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

but next time you should cc Ben Dooks to pick it up (i2c for embedded).

> ---
>  drivers/i2c/busses/i2c-octeon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
> index 0e9f85d..56dbe54 100644
> --- a/drivers/i2c/busses/i2c-octeon.c
> +++ b/drivers/i2c/busses/i2c-octeon.c
> @@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
>  		return result;
>  	} else if (result == 0) {
>  		dev_dbg(i2c->dev, "%s: timeout\n", __func__);
> -		result = -ETIMEDOUT;
> +		return -ETIMEDOUT;
>  	}
>  
>  	return 0;
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

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

* Re: [PATCH] MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
       [not found] ` <1285584916-21317-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
  2010-09-27 11:02   ` Wolfram Sang
@ 2010-09-27 17:32   ` David Daney
       [not found]     ` <4CA0D516.9060404-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: David Daney @ 2010-09-27 17:32 UTC (permalink / raw)
  To: Bernhard Walle
  Cc: khali-PUYAD+kWke1g9hUCZPvPmw, rade.bozic.ext-OYasijW0DpE,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 09/27/2010 03:55 AM, Bernhard Walle wrote:
> It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
> afterwards. Since there's code in octeon_i2c_start() to handle the
> error, it should be called.
>
> Signed-off-by: Bernhard Walle<walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>

Thanks for fixing this.

Acked-by: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>


> ---
>   drivers/i2c/busses/i2c-octeon.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
> index 0e9f85d..56dbe54 100644
> --- a/drivers/i2c/busses/i2c-octeon.c
> +++ b/drivers/i2c/busses/i2c-octeon.c
> @@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
>   		return result;
>   	} else if (result == 0) {
>   		dev_dbg(i2c->dev, "%s: timeout\n", __func__);
> -		result = -ETIMEDOUT;
> +		return -ETIMEDOUT;
>   	}
>
>   	return 0;

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

* Re: [PATCH] MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
       [not found]     ` <4CA0D516.9060404-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
@ 2010-09-27 22:12       ` Ben Dooks
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-09-27 22:12 UTC (permalink / raw)
  To: David Daney
  Cc: Bernhard Walle, khali-PUYAD+kWke1g9hUCZPvPmw,
	rade.bozic.ext-OYasijW0DpE, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, Sep 27, 2010 at 10:32:06AM -0700, David Daney wrote:
> On 09/27/2010 03:55 AM, Bernhard Walle wrote:
>> It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
>> afterwards. Since there's code in octeon_i2c_start() to handle the
>> error, it should be called.
>>
>> Signed-off-by: Bernhard Walle<walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
>
> Thanks for fixing this.
>
> Acked-by: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>

Ok, will put into my for -rc6 branch.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 10:55 [PATCH] MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout Bernhard Walle
     [not found] ` <1285584916-21317-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
2010-09-27 11:02   ` Wolfram Sang
2010-09-27 17:32   ` David Daney
     [not found]     ` <4CA0D516.9060404-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-09-27 22:12       ` Ben Dooks

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