mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@sifive.com>
To: linux-i3c@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com,
	Jude Onyenegecha <jude.onyenegecha@sifive.com>,
	Sudip Mukherjee <sudip.mukherjee@sifive.com>,
	Ben Dooks <ben.dooks@sifive.com>
Subject: [PATCH] i3c: master; add error print for invalid node
Date: Fri,  8 Jul 2022 17:49:48 +0100	[thread overview]
Message-ID: <20220708164948.268930-1-ben.dooks@sifive.com> (raw)

Show an error if the OF code in the i3c master setup
failed to read the register, so that if an incorrect
node is supplied there is an error print to make it
clear what the problem is

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
---
 drivers/i3c/master.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 7850287dfe7a..271d687d0d07 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2082,8 +2082,10 @@ static int of_i3c_master_add_dev(struct i3c_master_controller *master,
 		return -EINVAL;
 
 	ret = of_property_read_u32_array(node, "reg", reg, ARRAY_SIZE(reg));
-	if (ret)
+	if (ret) {
+		dev_err(&master->dev, "i3c: invalid reg for %pOF\n", node);
 		return ret;
+	}
 
 	/*
 	 * The manufacturer ID can't be 0. If reg[1] == 0 that means we're
-- 
2.35.1


                 reply	other threads:[~2022-07-08 16:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220708164948.268930-1-ben.dooks@sifive.com \
    --to=ben.dooks@sifive.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=jude.onyenegecha@sifive.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudip.mukherjee@sifive.com \
    /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

all inboxes | Powered by JetHome®