public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] i2c/mips: Fix error return codes from Sibyte i2c bus driver
Date: Tue, 22 Jun 2010 20:10:03 +0200	[thread overview]
Message-ID: <20100622201003.23318b09@hyperion.delvare> (raw)
In-Reply-To: <1277215748-31510-1-git-send-email-guenter.roeck@ericsson.com>

Hi Guenter,

On Tue, 22 Jun 2010 07:09:08 -0700, Guenter Roeck wrote:
> Sibyte i2c bus driver returns non-descriptive error values.
> Update to return error values as defined in Documentation/i2c/fault-codes.
> 
> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> ---
> v2: Return -ENXIO for missing ACK and -EIO for other errors
> ---
>  drivers/i2c/busses/i2c-sibyte.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
> index 3d76a18..0fe505d 100644
> --- a/drivers/i2c/busses/i2c-sibyte.c
> +++ b/drivers/i2c/busses/i2c-sibyte.c
> @@ -94,7 +94,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr,
>  		}
>  		break;
>  	default:
> -		return -1;      /* XXXKW better error code? */
> +		return -EOPNOTSUPP;
>  	}
>  
>  	while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY)
> @@ -104,7 +104,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr,
>  	if (error & M_SMB_ERROR) {
>  		/* Clear error bit by writing a 1 */
>  		csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS));
> -		return -1;      /* XXXKW better error code? */
> +		return (error & M_SMB_ERROR_TYPE) ? -EIO : -ENXIO;
>  	}
>  
>  	if (data_bytes == 1)

Very nice, patch applied, thanks.

-- 
Jean Delvare

      reply	other threads:[~2010-06-22 18:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 14:09 [PATCH v2] i2c/mips: Fix error return codes from Sibyte i2c bus driver Guenter Roeck
2010-06-22 18:10 ` Jean Delvare [this message]

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=20100622201003.23318b09@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=ben-linux@fluff.org \
    --cc=guenter.roeck@ericsson.com \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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