From: Laurent Pinchart Date: Wed, 3 Jul 2013 02:04:25 +0000 (-0300) Subject: [media] v4l: of: Use of_get_child_by_name() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=91f9241fd3487cd959abcf8c210af620ebfeb2cd;p=linux-beck.git [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 Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c index aa59639d013c..f64d95342bf1 100644 --- a/drivers/media/v4l2-core/v4l2-of.c +++ b/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);