git: 552503aca975 - main - rk_i2c_transfer: use iicbus error codes instead of generic ones

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 15 Dec 2021 11:16:39 UTC
The branch main has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=552503aca975ccab1b1f67f95f627e279db5826f

commit 552503aca975ccab1b1f67f95f627e279db5826f
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-12-15 08:38:24 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-15 11:14:56 +0000

    rk_i2c_transfer: use iicbus error codes instead of generic ones
    
    MFC after:      1 week
---
 sys/arm64/rockchip/rk_i2c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c
index 11aaf51f7e62..35257a2fe161 100644
--- a/sys/arm64/rockchip/rk_i2c.c
+++ b/sys/arm64/rockchip/rk_i2c.c
@@ -480,7 +480,7 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 		/* Validate parameters. */
 		if (msgs == NULL || msgs[i].buf == NULL ||
 		    msgs[i].len == 0) {
-			err = EINVAL;
+			err = IIC_ENOTSUPP;
 			break;
 		}
 		/*
@@ -492,7 +492,7 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 			    ((msgs[i].flags & IIC_M_RD) !=
 			    (msgs[i + 1].flags & IIC_M_RD) ||
 			    (msgs[i].slave !=  msgs[i + 1].slave))) {
-				err = EINVAL;
+				err = IIC_ENOTSUPP;
 				break;
 			}
 		}
@@ -551,7 +551,7 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 				DELAY(1000);
 			}
 			if (timeout <= 0)
-				err = ETIMEDOUT;
+				err = IIC_ETIMEOUT;
 		} else {
 			while (err == 0 && sc->transfer_done != 1) {
 				err = msleep(sc, &sc->mtx, PZERO, "rk_i2c",