From 4960f290c8bc4ad1458a05234f2b035b4dd0a479 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Mon, 17 Jun 2024 21:16:47 +0800 Subject: [PATCH] drivers/i3c: avoid return error when i3c_master_register without i3c/i2c device 1. if i3c_mater_register without i3c/i2c device, rstdaa/clearevents/do_daa could be failed 2. board code/driver code need to actively i3c_master_do_daa when device power on. Signed-off-by: dongjiuzhu1 --- drivers/i3c/master.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index c0c74b1cff..30bf899b79 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1032,7 +1032,8 @@ static int i3c_master_bus_init(FAR struct i3c_master_controller *master) ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); if (ret && ret != I3C_ERROR_M2) { - goto err_bus_cleanup; + i3cerr("master_rstdaa_locked() failed:%d (no device or timeout)\n", + ret); } /* Disable all slave events before starting DAA. */ @@ -1042,7 +1043,8 @@ static int i3c_master_bus_init(FAR struct i3c_master_controller *master) I3C_CCC_EVENT_HJ); if (ret && ret != I3C_ERROR_M2) { - goto err_bus_cleanup; + i3cerr("master_disec_locked() failed:%d (no device or timeout)\n", + ret); } /* Reserve init_dyn_addr first, and then try to pre-assign dynamic @@ -1055,14 +1057,12 @@ static int i3c_master_bus_init(FAR struct i3c_master_controller *master) ret = i3c_master_do_daa(master); if (ret) { - goto err_rstdaa; + i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); + i3cerr("master_do_daa failed:%d (no device)\n", ret); } return 0; -err_rstdaa: - i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); - err_bus_cleanup: if (master->ops->bus_cleanup) {