[PATCH 5/5] drm/tilcdc: Avoid error print by of_graph_get_next_endpoint()
Jyri Sarha
jsarha at ti.com
Tue Jun 14 11:50:42 UTC 2016
On 06/14/16 14:45, Jyri Sarha wrote:
> Avoid error print by of_graph_get_next_endpoint() if there is no ports
> present.
>
> Signed-off-by: Jyri Sarha <jsarha at ti.com>
> ---
> drivers/gpu/drm/tilcdc/tilcdc_external.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
> index 03acb4f..51811e3 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_external.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
> @@ -138,9 +138,20 @@ static int dev_match_of(struct device *dev, void *data)
> int tilcdc_get_external_components(struct device *dev,
> struct component_match **match)
> {
> + struct device_node *node;
> struct device_node *ep = NULL;
> int count = 0;
>
> + /* Avoid error print by of_graph_get_next_endpoint() if there
> + * is no ports present.
> + */
> + node = of_get_child_by_name(dev->of_node, "ports");
> + if (!node)
> + node = of_get_child_by_name(dev->of_node, "port");
> + if (!node)
> + return 0;
> + of_node_put(node);
> +
> while ((ep = of_graph_get_next_endpoint(dev->of_node, ep))) {
> struct device_node *node;
^^^^
Argh.. This now redundant local variable should have been removed. It is
now done in my local branch and will be in the v2 series, if there is
need for one.
BR,
Jyri
More information about the dri-devel
mailing list