summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/stm32
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2018-06-12 13:22:17 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-06-28 07:48:41 -0400
commitf8eb8e5c1f31f059677a80e0a902e64065695fa8 (patch)
treeab16ad7e65fb67bf655704424a77cacff78dba09 /drivers/media/platform/stm32
parentfdaf59582c037ca5bd23f23ab28c1c5c384c0520 (diff)
downloadlinux-stable-f8eb8e5c1f31f059677a80e0a902e64065695fa8.tar.gz
linux-stable-f8eb8e5c1f31f059677a80e0a902e64065695fa8.tar.bz2
linux-stable-f8eb8e5c1f31f059677a80e0a902e64065695fa8.zip
media: stm32-dcmi: drop unnecessary while(1) loop
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>
Diffstat (limited to 'drivers/media/platform/stm32')
-rw-r--r--drivers/media/platform/stm32/stm32-dcmi.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index db49db78e00d..9f6bb4165e54 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -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)