提交 f8eb8e5c 编写于 作者: N Nicholas Mc Guire 提交者: Mauro Carvalho Chehab

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: NNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 fdaf5958
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册