Skip to content

Commit af3be70

Browse files
ffainellirobherring
authored andcommitted
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>
1 parent 12eeae7 commit af3be70

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/of/base.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,9 @@ int of_phandle_iterator_next(struct of_phandle_iterator *it)
13501350
* property data length
13511351
*/
13521352
if (it->cur + count > it->list_end) {
1353-
pr_err("%pOF: arguments longer than property\n",
1354-
it->parent);
1353+
pr_err("%pOF: %s = %d found %d\n",
1354+
it->parent, it->cells_name,
1355+
count, it->cell_count);
13551356
goto err;
13561357
}
13571358
}

0 commit comments

Comments
 (0)