diff mbox

i2c: mv64xxx: Fix transfer error code

Message ID 1371678832-26889-1-git-send-email-linux@roeck-us.net
State Accepted
Headers show

Commit Message

Guenter Roeck June 19, 2013, 9:53 p.m. UTC
The driver returns -ENODEV as error code if it did not get an ACK
from the device. Per Documentation/i2c/fault-codes, it should
return -ENXIO.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/i2c/busses/i2c-mv64xxx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang June 20, 2013, 7:23 p.m. UTC | #1
On Wed, Jun 19, 2013 at 02:53:52PM -0700, Guenter Roeck wrote:
> The driver returns -ENODEV as error code if it did not get an ACK
> from the device. Per Documentation/i2c/fault-codes, it should
> return -ENXIO.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Thanks, have you checked the other error codes as well while you were
there?

> ---
>  drivers/i2c/busses/i2c-mv64xxx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> index 1a3abd6..6972032 100644
> --- a/drivers/i2c/busses/i2c-mv64xxx.c
> +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> @@ -227,7 +227,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
>  		/* Doesn't seem to be a device at other end */
>  		drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
>  		drv_data->state = MV64XXX_I2C_STATE_IDLE;
> -		drv_data->rc = -ENODEV;
> +		drv_data->rc = -ENXIO;
>  		break;
>  
>  	default:
> -- 
> 1.7.9.7
>
Guenter Roeck June 20, 2013, 9:12 p.m. UTC | #2
On Thu, Jun 20, 2013 at 09:23:37PM +0200, Wolfram Sang wrote:
> On Wed, Jun 19, 2013 at 02:53:52PM -0700, Guenter Roeck wrote:
> > The driver returns -ENODEV as error code if it did not get an ACK
> > from the device. Per Documentation/i2c/fault-codes, it should
> > return -ENXIO.
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Thanks, have you checked the other error codes as well while you were
> there?
> 
No; this is one that was discovered while testing a driver connected to the
controller. I'll check the others and let you know if I find any other problems.

Thanks,
Guenter

> > ---
> >  drivers/i2c/busses/i2c-mv64xxx.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> > index 1a3abd6..6972032 100644
> > --- a/drivers/i2c/busses/i2c-mv64xxx.c
> > +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> > @@ -227,7 +227,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
> >  		/* Doesn't seem to be a device at other end */
> >  		drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
> >  		drv_data->state = MV64XXX_I2C_STATE_IDLE;
> > -		drv_data->rc = -ENODEV;
> > +		drv_data->rc = -ENXIO;
> >  		break;
> >  
> >  	default:
> > -- 
> > 1.7.9.7
> > 


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Guenter Roeck June 21, 2013, 12:16 a.m. UTC | #3
On Thu, Jun 20, 2013 at 09:23:37PM +0200, Wolfram Sang wrote:
> On Wed, Jun 19, 2013 at 02:53:52PM -0700, Guenter Roeck wrote:
> > The driver returns -ENODEV as error code if it did not get an ACK
> > from the device. Per Documentation/i2c/fault-codes, it should
> > return -ENXIO.
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Thanks, have you checked the other error codes as well while you were
> there?
> 
Other error codes are ok as far as I can see.

Guenter

> > ---
> >  drivers/i2c/busses/i2c-mv64xxx.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> > index 1a3abd6..6972032 100644
> > --- a/drivers/i2c/busses/i2c-mv64xxx.c
> > +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> > @@ -227,7 +227,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
> >  		/* Doesn't seem to be a device at other end */
> >  		drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
> >  		drv_data->state = MV64XXX_I2C_STATE_IDLE;
> > -		drv_data->rc = -ENODEV;
> > +		drv_data->rc = -ENXIO;
> >  		break;
> >  
> >  	default:
> > -- 
> > 1.7.9.7
> > 


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang June 25, 2013, 4:42 p.m. UTC | #4
On Thu, Jun 20, 2013 at 05:16:27PM -0700, Guenter Roeck wrote:
> On Thu, Jun 20, 2013 at 09:23:37PM +0200, Wolfram Sang wrote:
> > On Wed, Jun 19, 2013 at 02:53:52PM -0700, Guenter Roeck wrote:
> > > The driver returns -ENODEV as error code if it did not get an ACK
> > > from the device. Per Documentation/i2c/fault-codes, it should
> > > return -ENXIO.
> > > 
> > > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > 
> > Thanks, have you checked the other error codes as well while you were
> > there?
> > 
> Other error codes are ok as far as I can see.

Applied to for-next, thanks for double checking!
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 1a3abd6..6972032 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -227,7 +227,7 @@  mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 		/* Doesn't seem to be a device at other end */
 		drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
 		drv_data->state = MV64XXX_I2C_STATE_IDLE;
-		drv_data->rc = -ENODEV;
+		drv_data->rc = -ENXIO;
 		break;
 
 	default: