Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -7
+3 -7
drivers/gpu/drm/drm_of.c
··· 43 43 uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, 44 44 struct device_node *port) 45 45 { 46 - struct device_node *remote_port, *ep = NULL; 46 + struct device_node *remote_port, *ep; 47 47 uint32_t possible_crtcs = 0; 48 48 49 - do { 50 - ep = of_graph_get_next_endpoint(port, ep); 51 - if (!ep) 52 - break; 53 - 49 + for_each_endpoint_of_node(port, ep) { 54 50 remote_port = of_graph_get_remote_port(ep); 55 51 if (!remote_port) { 56 52 of_node_put(ep); ··· 56 60 possible_crtcs |= drm_crtc_port_mask(dev, remote_port); 57 61 58 62 of_node_put(remote_port); 59 - } while (1); 63 + } 60 64 61 65 return possible_crtcs; 62 66 }