Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Dec 2021 06:59:15 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2dae9e96a70f - stable/12 - rk_i2c_transfer: use iicbus error codes instead of generic ones
Message-ID:  <202112220659.1BM6xFEQ036807@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=2dae9e96a70f3a4c0c4fc3f88e9e110a744f7135

commit 2dae9e96a70f3a4c0c4fc3f88e9e110a744f7135
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-12-15 08:38:24 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-22 06:57:00 +0000

    rk_i2c_transfer: use iicbus error codes instead of generic ones
    
    (cherry picked from commit 552503aca975ccab1b1f67f95f627e279db5826f)
---
 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 1a70f58ba02f..5bf37b906044 100644
--- a/sys/arm64/rockchip/rk_i2c.c
+++ b/sys/arm64/rockchip/rk_i2c.c
@@ -459,7 +459,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;
 		}
 		/*
@@ -471,7 +471,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;
 			}
 		}
@@ -530,7 +530,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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112220659.1BM6xFEQ036807>