diff mbox series

[RFC,2/5] i3c: add error print to show device failing during populate bus

Message ID 20230621162005.473049-3-ben.dooks@codethink.co.uk (mailing list archive)
State Rejected
Headers show
Series updates for i3c error printing | expand

Commit Message

Ben Dooks June 21, 2023, 4:20 p.m. UTC
The of_populate_i3c_bus() does not produce much helpful output when
a device fails to add, so addd an explicit dev_err() showing the
device node that failed and the error code it failed with. This should
make finding bad device-tree entries easier.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/i3c/master.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 559fc2781a81..6316f3fc914a 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2125,6 +2125,8 @@  static int of_populate_i3c_bus(struct i3c_master_controller *master)
 	for_each_available_child_of_node(i3cbus_np, node) {
 		ret = of_i3c_master_add_dev(master, node);
 		if (ret) {
+			dev_err(dev, "%pOF: failed to add device (%d)\n",
+				node, ret);
 			of_node_put(node);
 			return ret;
 		}