linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i3c: master; add error print for invalid node
@ 2022-07-08 16:49 Ben Dooks
  0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2022-07-08 16:49 UTC (permalink / raw)
  To: linux-i3c
  Cc: linux-kernel, alexandre.belloni, Jude Onyenegecha,
	Sudip Mukherjee, Ben Dooks

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


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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-09 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 16:49 [PATCH] i3c: master; add error print for invalid node Ben Dooks

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 NNTP newsgroup(s).