arm64: rockchip: rk805: Switch to iicdev_{readfrom,writeto}

This simpify the code a bit.
This commit is contained in:
Emmanuel Vadot 2019-10-01 18:30:06 +00:00
parent 546d30b94b
commit 361a394828

View File

@ -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