Commit 91f9241f authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 8023ed09
...@@ -173,12 +173,8 @@ struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent, ...@@ -173,12 +173,8 @@ struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
if (node) if (node)
parent = node; parent = node;
for_each_child_of_node(parent, node) { port = of_get_child_by_name(parent, "port");
if (!of_node_cmp(node->name, "port")) {
port = node;
break;
}
}
if (port) { if (port) {
/* Found a port, get an endpoint. */ /* Found a port, get an endpoint. */
endpoint = of_get_next_child(port, NULL); endpoint = of_get_next_child(port, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment