of_node_cmp() compares the whole node name for matching whereas
of_node_name_eq() only compares the part before the '@' sign. For
of_graph_get_next_endpoint() we need the latter. Fix this.

Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 drivers/of/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 398e39340f..5981650f2a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -3353,7 +3353,7 @@ struct device_node *of_graph_get_next_endpoint(const 
struct device_node *parent,
                        port = of_get_next_child(parent, port);
                        if (!port)
                                return NULL;
-               } while (of_node_cmp(port->name, "port"));
+               } while (port->name && !of_node_name_eq(port, "port"));
        }
 }
 EXPORT_SYMBOL(of_graph_get_next_endpoint);

-- 
2.39.5


Reply via email to