diff --git a/sys/arm64/rockchip/rk805.c b/sys/arm64/rockchip/rk805.c index 37a717fe1f0b..a68a1dd66880 100644 --- a/sys/arm64/rockchip/rk805.c +++ b/sys/arm64/rockchip/rk805.c @@ -227,24 +227,16 @@ static struct rk805_regdef rk808_regdefs[] = { static int rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { + int err; - return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); + err = iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT); + return (err); } static int rk805_write(device_t dev, uint8_t reg, uint8_t data) { - struct iic_msg msg; - uint8_t buf[2]; - - buf[0] = reg; - buf[1] = data; - msg.slave = iicbus_get_addr(dev); - msg.flags = IIC_M_WR; - msg.buf = buf; - msg.len = sizeof(buf); - - return (iicbus_transfer_excl(dev, &msg, 1, IIC_INTRWAIT)); + return (iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); } static int