aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2021-12-15 08:38:24 +0000
committerAndriy Gapon <avg@FreeBSD.org>2021-12-15 11:14:56 +0000
commit552503aca975ccab1b1f67f95f627e279db5826f (patch)
treec69a628dc24a8daed909ec68972de6396eddf5e1
parent5f863d7e1319afe32d18e505c26acaacfcae0db7 (diff)
downloadsrc-552503aca975ccab1b1f67f95f627e279db5826f.tar.gz
src-552503aca975ccab1b1f67f95f627e279db5826f.zip
rk_i2c_transfer: use iicbus error codes instead of generic ones
MFC after: 1 week
-rw-r--r--sys/arm64/rockchip/rk_i2c.c6
1 files 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",