of: Reduce log level of of_phandle_iterator_next()
diff mbox series

Message ID 20191120040045.81115-1-saravanak@google.com
State New
Headers show
Series
  • of: Reduce log level of of_phandle_iterator_next()
Related show

Commit Message

Saravana Kannan Nov. 20, 2019, 4 a.m. UTC
These error messages are mostly useful for debugging malformed device
tree data. So change these messages from error to debug messages to
avoid spamming the end user. Any error messages that might actually be
useful to the user is probably going to come from the caller of these
APIs. So leave it to them to decide if they need to print any error
messages.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/of/base.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Rob Herring Nov. 20, 2019, 4:09 p.m. UTC | #1
On Tue, Nov 19, 2019 at 10:00 PM Saravana Kannan <saravanak@google.com> wrote:
>
> These error messages are mostly useful for debugging malformed device
> tree data.

A malformed DT is an error, no?

> So change these messages from error to debug messages to
> avoid spamming the end user. Any error messages that might actually be
> useful to the user is probably going to come from the caller of these
> APIs. So leave it to them to decide if they need to print any error
> messages.

Generally that pattern results in every caller doing their own message
which is the wrong way around IMO. And recent patches fix some of
those cases[1].

Rob

[1] https://lkml.org/lkml/2019/7/30/41

Patch
diff mbox series

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 1d667eb730e1..4762e826f13e 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1335,8 +1335,8 @@  int of_phandle_iterator_next(struct of_phandle_iterator *it)
 
 		if (it->cells_name) {
 			if (!it->node) {
-				pr_err("%pOF: could not find phandle\n",
-				       it->parent);
+				pr_debug("%pOF: could not find phandle\n",
+					 it->parent);
 				goto err;
 			}
 
@@ -1350,10 +1350,10 @@  int of_phandle_iterator_next(struct of_phandle_iterator *it)
 				if (it->cell_count >= 0) {
 					count = it->cell_count;
 				} else {
-					pr_err("%pOF: could not get %s for %pOF\n",
-					       it->parent,
-					       it->cells_name,
-					       it->node);
+					pr_debug("%pOF: could not get %s for %pOF\n",
+						 it->parent,
+						 it->cells_name,
+						 it->node);
 					goto err;
 				}
 			}
@@ -1366,9 +1366,9 @@  int of_phandle_iterator_next(struct of_phandle_iterator *it)
 		 * property data length
 		 */
 		if (it->cur + count > it->list_end) {
-			pr_err("%pOF: %s = %d found %d\n",
-			       it->parent, it->cells_name,
-			       count, it->cell_count);
+			pr_debug("%pOF: %s = %d found %d\n",
+				 it->parent, it->cells_name,
+				 count, it->cell_count);
 			goto err;
 		}
 	}