Browse Source

[media] v4l: of: Use of_get_child_by_name()

Replace a manual loop through child nodes with a call to
of_get_child_by_name().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart 12 years ago
parent
commit
91f9241fd3
1 changed files with 2 additions and 6 deletions
  1. 2 6
      drivers/media/v4l2-core/v4l2-of.c

+ 2 - 6
drivers/media/v4l2-core/v4l2-of.c

@@ -173,12 +173,8 @@ struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
 		if (node)
 			parent = node;
 
-		for_each_child_of_node(parent, node) {
-			if (!of_node_cmp(node->name, "port")) {
-				port = node;
-				break;
-			}
-		}
+		port = of_get_child_by_name(parent, "port");
+
 		if (port) {
 			/* Found a port, get an endpoint. */
 			endpoint = of_get_next_child(port, NULL);