On Sun, Nov 17, 2019 at 7:26 PM David.Wu <david...@rock-chips.com> wrote: > > 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?
I'm not sure if it's a good idea to continue communication if we've got a failure and sending a stop bit is continuing communication. But I'm not an expert in i2c and I don't have any strong opinion on that, so I can send v2 with change you proposed. > @@ -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; > } > > > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot