Linux-i3c Archive mirror
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
	alexandre.belloni@bootlin.com
Cc: Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [RFC 2/5] i3c: add error print to show device failing during populate bus
Date: Wed, 21 Jun 2023 17:20:02 +0100	[thread overview]
Message-ID: <20230621162005.473049-3-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk>

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


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  parent reply	other threads:[~2023-06-29 10:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 16:20 [RFC 0/5] updates for i3c error printing Ben Dooks
2023-06-21 16:20 ` [RFC 1/5] i3c: show error with node for invalid reg property Ben Dooks
2023-06-21 16:20 ` Ben Dooks [this message]
2023-06-21 16:20 ` [RFC 3/5] i3c: show node when printing unsupported 10-bit i2c dev Ben Dooks
2023-06-21 16:20 ` [RFC 4/5] i3c: show error messages in of_i3c_master_add_i3c_boardinfo Ben Dooks
2023-06-21 16:20 ` [RFC 5/5] i3c: dw; add print if cannot get resources Ben Dooks
2023-07-04 21:37   ` Alexandre Belloni
2023-07-11  8:52     ` Ben Dooks
2023-07-04  8:24 ` [RFC 0/5] updates for i3c error printing Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621162005.473049-3-ben.dooks@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).