2019-12-12 00:07:50

by Christoph Muellner

[permalink] [raw]
Subject: [PATCH] i2c: tiny-usb: Correct I2C fault codes.

From: Christoph Müllner <[email protected]>

This patch changes the I2C fault codes according to the specified
values in Documentation/i2c/fault-codes.

Signed-off-by: Christoph Müllner <[email protected]>
---
drivers/i2c/busses/i2c-tiny-usb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index 43e3603489ee..7279ca0eaa2d 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -84,7 +84,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
pmsg->buf, pmsg->len) != pmsg->len) {
dev_err(&adapter->dev,
"failure reading data\n");
- ret = -EREMOTEIO;
+ ret = -EIO;
goto out;
}
} else {
@@ -94,7 +94,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
pmsg->buf, pmsg->len) != pmsg->len) {
dev_err(&adapter->dev,
"failure writing data\n");
- ret = -EREMOTEIO;
+ ret = -EIO;
goto out;
}
}
@@ -102,13 +102,13 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
/* read status */
if (usb_read(adapter, CMD_GET_STATUS, 0, 0, pstatus, 1) != 1) {
dev_err(&adapter->dev, "failure reading status\n");
- ret = -EREMOTEIO;
+ ret = -EIO;
goto out;
}

dev_dbg(&adapter->dev, " status = %d\n", *pstatus);
if (*pstatus == STATUS_ADDRESS_NAK) {
- ret = -EREMOTEIO;
+ ret = -ENXIO;
goto out;
}
}
--
2.23.0


2020-01-06 14:43:04

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: tiny-usb: Correct I2C fault codes.

On Thu, Dec 12, 2019 at 12:39:05AM +0100, [email protected] wrote:
> From: Christoph Müllner <[email protected]>
>
> This patch changes the I2C fault codes according to the specified
> values in Documentation/i2c/fault-codes.
>
> Signed-off-by: Christoph Müllner <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (397.00 B)
signature.asc (849.00 B)
Download all attachments