Hi Wolfram,

On Tue, 20 May 2008 19:18:49 +0200, Wolfram Sang wrote:
> Give a more concrete error code, when the bus is not idle.
> 
> Signed-off-by: Wolfram Sang <[EMAIL PROTECTED]>
> ---
> 
>  drivers/i2c/algos/i2c-algo-pca.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/algos/i2c-algo-pca.c 
> b/drivers/i2c/algos/i2c-algo-pca.c
> index e954a20..8001d6d 100644
> --- a/drivers/i2c/algos/i2c-algo-pca.c
> +++ b/drivers/i2c/algos/i2c-algo-pca.c
> @@ -182,7 +182,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
>       }
>       if (state != 0xf8) {
>               dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", 
> state);
> -             return -EIO;
> +             return -EBUSY;
>       }
>  
>       DEB1("{{{ XFER %d messages\n", num);

EBUSY is a fatal error, while a you should be able to retry the
transaction later when the bus is free. So I think that EAGAIN would be
more appropriate.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to