public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] i2c-pca-algo: Fix errorcode
Date: Tue, 20 May 2008 20:17:55 +0200	[thread overview]
Message-ID: <20080520201755.59b140f5@hyperion.delvare> (raw)
In-Reply-To: <20080520171848.10908.23451.stgit-WosDo8ZsKtpoC+DoxizDebTfikLOBL9CDsAVuJBuCrE@public.gmane.org>

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 <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> 
>  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
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-05-20 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 17:18 [PATCH] i2c-pca-algo: Fix errorcode Wolfram Sang
     [not found] ` <20080520171848.10908.23451.stgit-WosDo8ZsKtpoC+DoxizDebTfikLOBL9CDsAVuJBuCrE@public.gmane.org>
2008-05-20 18:17   ` Jean Delvare [this message]
     [not found]     ` <20080520201755.59b140f5-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-05-20 19:42       ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080520201755.59b140f5@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox