summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/armada/armada_drv.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-01-24 09:56:46 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2019-06-28 14:50:07 +0100
commit989b9a7dd4ab40eb63026754b10527bf1d03bf86 (patch)
tree9fe7b0561aa9b53abd333daaa19352f3c523efaa /drivers/gpu/drm/armada/armada_drv.c
parentf54a5990c32978dcb84ef1d38d22457bf3129797 (diff)
drm/armada: use for_each_endpoint_of_node() to walk crtc endpoints
Rather than having a nested set of for_each_child_of_node() walkers, use the graph walker to iterate through the endpoints for CRTCs. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada/armada_drv.c')
-rw-r--r--drivers/gpu/drm/armada/armada_drv.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 05fab5cb5c2d..1cfabcd6a629 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -204,11 +204,11 @@ static int compare_dev_name(struct device *dev, void *data)
}
static void armada_add_endpoints(struct device *dev,
- struct component_match **match, struct device_node *port)
+ struct component_match **match, struct device_node *dev_node)
{
struct device_node *ep, *remote;
- for_each_child_of_node(port, ep) {
+ for_each_endpoint_of_node(dev_node, ep) {
remote = of_graph_get_remote_port_parent(ep);
if (!remote || !of_device_is_available(remote)) {
of_node_put(remote);
@@ -242,7 +242,6 @@ static int armada_drm_probe(struct platform_device *pdev)
if (dev->platform_data) {
char **devices = dev->platform_data;
- struct device_node *port;
struct device *d;
int i;
@@ -258,10 +257,8 @@ static int armada_drm_probe(struct platform_device *pdev)
for (i = 0; devices[i]; i++) {
d = bus_find_device_by_name(&platform_bus_type, NULL,
devices[i]);
- if (d && d->of_node) {
- for_each_child_of_node(d->of_node, port)
- armada_add_endpoints(dev, &match, port);
- }
+ if (d && d->of_node)
+ armada_add_endpoints(dev, &match, d->of_node);
put_device(d);
}
}