* [PATCH] i2c: tiny-usb: Correct I2C fault codes.
@ 2019-12-11 23:39 christoph.muellner
2020-01-06 14:42 ` Wolfram Sang
0 siblings, 1 reply; 3+ messages in thread
From: christoph.muellner @ 2019-12-11 23:39 UTC (permalink / raw)
To: Till Harbaum, linux-i2c, linux-kernel, christoph.muellner
From: Christoph Müllner <christoph.muellner@theobroma-systems.com>
This patch changes the I2C fault codes according to the specified
values in Documentation/i2c/fault-codes.
Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] i2c: tiny-usb: Correct I2C fault codes.
@ 2019-12-12 0:12 christoph.muellner
0 siblings, 0 replies; 3+ messages in thread
From: christoph.muellner @ 2019-12-12 0:12 UTC (permalink / raw)
Cc: Christoph Müllner, Till Harbaum, linux-i2c, linux-kernel
From: Christoph Müllner <christoph.muellner@theobroma-systems.com>
This patch changes the I2C fault codes according to the specified
values in Documentation/i2c/fault-codes.
Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: tiny-usb: Correct I2C fault codes.
2019-12-11 23:39 [PATCH] i2c: tiny-usb: Correct I2C fault codes christoph.muellner
@ 2020-01-06 14:42 ` Wolfram Sang
0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-01-06 14:42 UTC (permalink / raw)
To: christoph.muellner; +Cc: Till Harbaum, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
On Thu, Dec 12, 2019 at 12:39:05AM +0100, christoph.muellner@theobroma-systems.com wrote:
> From: Christoph Müllner <christoph.muellner@theobroma-systems.com>
>
> This patch changes the I2C fault codes according to the specified
> values in Documentation/i2c/fault-codes.
>
> Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-06 14:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-11 23:39 [PATCH] i2c: tiny-usb: Correct I2C fault codes christoph.muellner
2020-01-06 14:42 ` Wolfram Sang
-- strict thread matches above, loose matches on Subject: below --
2019-12-12 0:12 christoph.muellner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).