]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
media: stm32-dcmi: drop unnecessary while(1) loop
authorNicholas Mc Guire <hofrat@osadl.org>
Tue, 12 Jun 2018 17:22:17 +0000 (13:22 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Jun 2018 11:48:41 +0000 (07:48 -0400)
The while(1) is effectively useless as all possible paths within it
return thus there is no way to loop.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/stm32/stm32-dcmi.c

index db49db78e00db02a4f9e752cadc21470b8501d5f..9f6bb4165e54edf0e811b04f464e2fb509db8faf 100644 (file)
@@ -1567,23 +1567,21 @@ static int dcmi_graph_parse(struct stm32_dcmi *dcmi, struct device_node *node)
        struct device_node *ep = NULL;
        struct device_node *remote;
 
-       while (1) {
-               ep = of_graph_get_next_endpoint(node, ep);
-               if (!ep)
-                       return -EINVAL;
-
-               remote = of_graph_get_remote_port_parent(ep);
-               if (!remote) {
-                       of_node_put(ep);
-                       return -EINVAL;
-               }
+       ep = of_graph_get_next_endpoint(node, ep);
+       if (!ep)
+               return -EINVAL;
 
-               /* Remote node to connect */
-               dcmi->entity.node = remote;
-               dcmi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
-               dcmi->entity.asd.match.fwnode = of_fwnode_handle(remote);
-               return 0;
+       remote = of_graph_get_remote_port_parent(ep);
+       if (!remote) {
+               of_node_put(ep);
+               return -EINVAL;
        }
+
+       /* Remote node to connect */
+       dcmi->entity.node = remote;
+       dcmi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
+       dcmi->entity.asd.match.fwnode = of_fwnode_handle(remote);
+       return 0;
 }
 
 static int dcmi_graph_init(struct stm32_dcmi *dcmi)