linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: Improve of_phandle_iterator_next() error message
@ 2019-04-03 17:56 Florian Fainelli
  2019-04-10 14:07 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2019-04-03 17:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Rob Herring, Frank Rowand,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE

Understanding why of_phandle_iterator_next() returns an error can
sometimes be hard to decipher based solely on the error message, a
typical error example is that #foo-cells = <X> and the phandle property
used has a smaller number of cells specified, e.g.:

	#thermal-sensor-cells = <1>;
	phandle = <&scmi_sensor>

instead of:

	phandle <&scmi_sensor 0>;

Instead, make it clear what the expectations are towards debugging
incorrect Device Tree faster:

OF: /thermal-zones/scmi-thermal: #thermal-sensor-cells = 1, found 0 instead

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/of/base.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5226e898476e..20e0e7ee4edf 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1350,8 +1350,9 @@ int of_phandle_iterator_next(struct of_phandle_iterator *it)
 		 * property data length
 		 */
 		if (it->cur + count > it->list_end) {
-			pr_err("%pOF: arguments longer than property\n",
-			       it->parent);
+			pr_err("%pOF: %s = %d found %d\n",
+			       it->parent, it->cells_name,
+			       count, it->cell_count);
 			goto err;
 		}
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] of: Improve of_phandle_iterator_next() error message
  2019-04-03 17:56 [PATCH] of: Improve of_phandle_iterator_next() error message Florian Fainelli
@ 2019-04-10 14:07 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-04-10 14:07 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Frank Rowand,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE

On Wed, Apr 03, 2019 at 10:56:33AM -0700, Florian Fainelli wrote:
> Understanding why of_phandle_iterator_next() returns an error can
> sometimes be hard to decipher based solely on the error message, a
> typical error example is that #foo-cells = <X> and the phandle property
> used has a smaller number of cells specified, e.g.:
> 
> 	#thermal-sensor-cells = <1>;
> 	phandle = <&scmi_sensor>
> 
> instead of:
> 
> 	phandle <&scmi_sensor 0>;
> 
> Instead, make it clear what the expectations are towards debugging
> incorrect Device Tree faster:
> 
> OF: /thermal-zones/scmi-thermal: #thermal-sensor-cells = 1, found 0 instead
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/of/base.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied.

Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-10 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 17:56 [PATCH] of: Improve of_phandle_iterator_next() error message Florian Fainelli
2019-04-10 14:07 ` Rob Herring

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).