Commit b6babdd9 authored by Philipp Zabel's avatar Philipp Zabel Committed by Russell King

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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 655b43cc
...@@ -501,8 +501,9 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, ...@@ -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 imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc);
struct device_node *ep = NULL; struct device_node *ep = NULL;
struct of_endpoint endpoint;
struct device_node *port; struct device_node *port;
int id, ret; int ret;
if (!node || !imx_crtc) if (!node || !imx_crtc)
return -EINVAL; return -EINVAL;
...@@ -515,9 +516,8 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, ...@@ -515,9 +516,8 @@ int imx_drm_encoder_get_mux_id(struct device_node *node,
port = of_graph_get_remote_port(ep); port = of_graph_get_remote_port(ep);
of_node_put(port); of_node_put(port);
if (port == imx_crtc->port) { if (port == imx_crtc->port) {
ret = of_property_read_u32(ep->parent, "reg", &id); ret = of_graph_parse_endpoint(ep, &endpoint);
of_node_put(ep); return ret ? ret : endpoint.id;
return ret ? ret : id;
} }
} while (ep); } while (ep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment