treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / omapdrm / dss / dss-of.c
blobb7981f3b80adcf19f439e87f24b1975523bd1047
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
4 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 */
7 #include <linux/err.h>
8 #include <linux/of.h>
9 #include <linux/of_graph.h>
11 #include "omapdss.h"
13 struct omap_dss_device *
14 omapdss_of_find_connected_device(struct device_node *node, unsigned int port)
16 struct device_node *remote_node;
17 struct omap_dss_device *dssdev;
19 remote_node = of_graph_get_remote_node(node, port, 0);
20 if (!remote_node)
21 return NULL;
23 dssdev = omapdss_find_device_by_node(remote_node);
24 of_node_put(remote_node);
26 return dssdev ? dssdev : ERR_PTR(-EPROBE_DEFER);
28 EXPORT_SYMBOL_GPL(omapdss_of_find_connected_device);