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;
 }



_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to