aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2021-12-15 08:40:22 +0000
committerAndriy Gapon <avg@FreeBSD.org>2021-12-15 11:15:23 +0000
commit1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b (patch)
treea736c252f2784c1df9e62211773db2417336486a /sys
parent552503aca975ccab1b1f67f95f627e279db5826f (diff)
downloadsrc-1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b.tar.gz
src-1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b.zip
Diffstat (limited to 'sys')
-rw-r--r--sys/arm64/rockchip/rk_i2c.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c
index 35257a2fe161..18b7b2255e17 100644
--- a/sys/arm64/rockchip/rk_i2c.c
+++ b/sys/arm64/rockchip/rk_i2c.c
@@ -304,9 +304,9 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc)
if (sc->ipd & RK_I2C_IPD_NAKRCVIPD) {
/* NACK received */
sc->ipd &= ~RK_I2C_IPD_NAKRCVIPD;
- sc->nak_recv = 1;
+ sc->nak_recv = true;
/* XXXX last byte !!!, signal error !!! */
- sc->transfer_done = 1;
+ sc->transfer_done = true;
sc->state = STATE_IDLE;
goto err;
}
@@ -546,14 +546,14 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
if (cold) {
for(timeout = 10000; timeout > 0; timeout--) {
rk_i2c_intr_locked(sc);
- if (sc->transfer_done != 0)
+ if (sc->transfer_done)
break;
DELAY(1000);
}
if (timeout <= 0)
err = IIC_ETIMEOUT;
} else {
- while (err == 0 && sc->transfer_done != 1) {
+ while (err == 0 && !sc->transfer_done) {
err = msleep(sc, &sc->mtx, PZERO, "rk_i2c",
10 * hz);
}