[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230621162005.473049-2-ben.dooks@codethink.co.uk>
Date: Wed, 21 Jun 2023 17:20:01 +0100
From: Ben Dooks <ben.dooks@...ethink.co.uk>
To: linux-i3c@...ts.infradead.org, linux-kernel@...r.kernel.org,
alexandre.belloni@...tlin.com
Cc: Ben Dooks <ben.dooks@...ethink.co.uk>
Subject: [RFC 1/5] i3c: show error with node for invalid reg property
When adding i3c devices via fdt, it is useful to get an error if the
reg node is wrong (say, you thought it was an i2c device and only
needed one value here) and have the error show the OF node which was
the cause of the problem (in case of many devices in the system),
Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
---
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 08aeb69a7800..559fc2781a81 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2094,8 +2094,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, "%pOF: invalid reg property", node);
return ret;
+ }
/*
* The manufacturer ID can't be 0. If reg[1] == 0 that means we're
--
2.40.1
Powered by blists - more mailing lists