aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2019-04-03 13:56:33 -0400
committerRob Herring <robh@kernel.org>2019-04-10 17:33:48 -0400
commitaf3be70a32113787da9f15e4ce8a357ae6caa293 (patch)
treeaea9bef4c73b39fa7d7235c2437a01f6ed824bbf
parent12eeae7147af32f7d3bbf0f1753313f88b8ce97b (diff)
of: Improve of_phandle_iterator_next() error message
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> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--drivers/of/base.c5
1 files 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)
1350 * property data length 1350 * property data length
1351 */ 1351 */
1352 if (it->cur + count > it->list_end) { 1352 if (it->cur + count > it->list_end) {
1353 pr_err("%pOF: arguments longer than property\n", 1353 pr_err("%pOF: %s = %d found %d\n",
1354 it->parent); 1354 it->parent, it->cells_name,
1355 count, it->cell_count);
1355 goto err; 1356 goto err;
1356 } 1357 }
1357 } 1358 }