diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-07-04 00:59:51 +0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2015-04-08 12:14:25 +0300 |
commit | 7416f4e33b5e924baa030ddab1f261a0a85fa32e (patch) | |
tree | 413aa5ce065483e6d7529b66a9043e2418785033 /drivers/gpu/drm/drm_of.c | |
parent | 01218bf14ee60d4a2d6c667ebdbba3ae9a7a1d66 (diff) | |
download | linux-7416f4e33b5e924baa030ddab1f261a0a85fa32e.tar.xz |
drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs
Using the for_each_... macro should make the code a bit shorter and
easier to read.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/drm_of.c')
-rw-r--r-- | drivers/gpu/drm/drm_of.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 16150a00c237..aaa130736bf8 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -43,14 +43,10 @@ static uint32_t drm_crtc_port_mask(struct drm_device *dev, uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *port) { - struct device_node *remote_port, *ep = NULL; + struct device_node *remote_port, *ep; uint32_t possible_crtcs = 0; - do { - ep = of_graph_get_next_endpoint(port, ep); - if (!ep) - break; - + for_each_endpoint_of_node(port, ep) { remote_port = of_graph_get_remote_port(ep); if (!remote_port) { of_node_put(ep); @@ -60,7 +56,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, possible_crtcs |= drm_crtc_port_mask(dev, remote_port); of_node_put(remote_port); - } while (1); + } return possible_crtcs; } |