diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2018-06-01 08:46:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-06-28 06:49:59 -0400 |
commit | e8ced209510164f0b54d4bb2a34d243a8af8f561 (patch) | |
tree | 373b7c01fd83fbedb29d109d5f3bf0a9c32178fc /drivers/media/platform/atmel | |
parent | e32eb0d8a6cdc965347b964e45e40c9254bd7408 (diff) | |
download | linux-stable-e8ced209510164f0b54d4bb2a34d243a8af8f561.tar.gz linux-stable-e8ced209510164f0b54d4bb2a34d243a8af8f561.tar.bz2 linux-stable-e8ced209510164f0b54d4bb2a34d243a8af8f561.zip |
media: atmel-isi: drop unnecessary while loop
As there is no way this can loop it actually makes no sense to have
a while(1){} around the body - all three possible paths end in a return
statement.
Fixes: commit c1d82b895380 "[media] atmel-isi: move out of soc_camera to atmel"
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
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/atmel')
-rw-r--r-- | drivers/media/platform/atmel/atmel-isi.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index e5be21a31640..85fc7b98b660 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1106,23 +1106,21 @@ static int isi_graph_parse(struct atmel_isi *isi, 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 */ - isi->entity.node = remote; - isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE; - isi->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 */ + isi->entity.node = remote; + isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE; + isi->entity.asd.match.fwnode = of_fwnode_handle(remote); + return 0; } static int isi_graph_init(struct atmel_isi *isi) |