[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141223120137.GA26129@pengutronix.de>
Date: Tue, 23 Dec 2014 13:01:37 +0100
From: Philipp Zabel <pza@...gutronix.de>
To: Andrzej Hajda <a.hajda@...sung.com>
Cc: Philipp Zabel <p.zabel@...gutronix.de>,
Grant Likely <grant.likely@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
kernel@...gutronix.de, Russell King <rmk+kernel@....linux.org.uk>,
Mauro Carvalho Chehab <m.chehab@...sung.com>,
Guennadi Liakhovetski <g.liakhovetski@....de>,
linux-arm-kernel@...ts.infradead.org, linux-media@...r.kernel.org
Subject: Re: [PATCH v6 3/3] of: Add of_graph_get_port_by_id function
Hi Andrzej,
On Tue, Dec 23, 2014 at 12:10:00PM +0100, Andrzej Hajda wrote:
[...]
> > /**
> > + * of_graph_get_port_by_id() - get the port matching a given id
> > + * @parent: pointer to the parent device node
>
> Here you have 'parent' and 'node' in the code.
[...]
> Maybe I miss something but it does not handle optional 'ports' node.
You missed nothing, thank you for the comments! I'll fix both issues
like this:
struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
{
struct device_node *node, *port;
node = of_get_child_by_name(parent, "ports");
if (node)
parent = node;
for_each_child_of_node(parent, port) {
u32 port_id = 0;
if (of_node_cmp(port->name, "port") != 0)
continue;
of_property_read_u32(port, "reg", &port_id);
if (id == port_id)
break;
}
of_node_put(node);
return port;
}
regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists