summaryrefslogtreecommitdiffstats
path: root/drivers/staging/imx-drm
diff options
context:
space:
mode:
authorPhilipp Zabel2014-03-05 10:20:53 +0100
committerRussell King2014-03-07 17:17:49 +0100
commitb6babdd93c1e679b49858d1ebe44144e93b744fb (patch)
treede33d6fc6536b75b53bef11794028fda894b5ce8 /drivers/staging/imx-drm
parentstaging: imx-drm-core: Use OF graph to find components and connections betwee... (diff)
downloadkernel-qcow2-linux-b6babdd93c1e679b49858d1ebe44144e93b744fb.tar.gz
kernel-qcow2-linux-b6babdd93c1e679b49858d1ebe44144e93b744fb.tar.xz
kernel-qcow2-linux-b6babdd93c1e679b49858d1ebe44144e93b744fb.zip
staging: imx-drm-core: use of_graph_parse_endpoint
Using of_graph_parse_endpoint recovers the port id from an endpoint device tree node. This just replaces an open coded read of the "reg" property. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/staging/imx-drm')
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index e4277f996574..f926931183ea 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -501,8 +501,9 @@ int imx_drm_encoder_get_mux_id(struct device_node *node,
{
struct imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc);
struct device_node *ep = NULL;
+ struct of_endpoint endpoint;
struct device_node *port;
- int id, ret;
+ int ret;
if (!node || !imx_crtc)
return -EINVAL;
@@ -515,9 +516,8 @@ int imx_drm_encoder_get_mux_id(struct device_node *node,
port = of_graph_get_remote_port(ep);
of_node_put(port);
if (port == imx_crtc->port) {
- ret = of_property_read_u32(ep->parent, "reg", &id);
- of_node_put(ep);
- return ret ? ret : id;
+ ret = of_graph_parse_endpoint(ep, &endpoint);
+ return ret ? ret : endpoint.id;
}
} while (ep);