[U-Boot] [PATCH] rockchip: i2c: don't sent stop bit after each message
David.Wu
david.wu at rock-chips.com
Mon Nov 18 03:25:52 UTC 2019
Hi Vasily,
在 2019/11/17 3:32, Vasily Khoruzhick 写道:
> + rk_i2c_send_stop_bit(i2c);
> + rk_i2c_disable(i2c);
I think it is better to also stop i2c if i2c xfer failed, how do you
feel about it?
@@ -356,11 +356,16 @@ static int rockchip_i2c_xfer(struct udevice *bus,
struct i2c_msg *msg,
}
if (ret) {
debug("i2c_write: error sending\n");
- return -EREMOTEIO;
+ ret = -EREMOTEIO;
+ goto exit;
}
}
- return 0;
+exit:
+ rk_i2c_send_stop_bit(i2c);
+ rk_i2c_disable(i2c);
+
+ return ret;
}
More information about the U-Boot
mailing list