MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
Subsystems (2)
PATCH 1/1 MIPS: I2C: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
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.
--- drivers/i2c/busses/i2c-octeon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-octeon.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.0.4
Quoted 5 lines · Bernhard Walle
It doesn't make sense to set result to
-ETIMEDOUTbut return 0 (success) afterwards. Since there's code inocteon_i2c_start()to handle the error, it should be called.Signed-off-by Bernhard Walle <[email protected]>
but next time you should cc Ben Dooks to pick it up (i2c for embedded).
Quoted 24 lines
--- drivers/i2c/busses/i2c-octeon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-octeon.c +1
-1@@ -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 ;Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 5 lines · Bernhard Walle
It doesn't make sense to set result to
-ETIMEDOUTbut return 0 (success) afterwards. Since there's code inocteon_i2c_start()to handle the error, it should be called.Signed-off-by Bernhard Walle<[email protected]>
Thanks for fixing this.
Quoted 17 lines
--- drivers/i2c/busses/i2c-octeon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-octeon.c +1
-1@@ -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 ;
Quoted 10 lines · David Daney
Quoted 5 lines · Bernhard Walle
It doesn't make sense to set result to
-ETIMEDOUTbut return 0 (success) afterwards. Since there's code inocteon_i2c_start()to handle the error, it should be called.Signed-off-by Bernhard Walle<[email protected]>Thanks for fixing this.
Acked-by David Daney <[email protected]>
Ok, will put into my for -rc6 branch.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.