diff options
| author | Sakari Ailus <[email protected]> | 2023-07-29 11:52:14 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2023-08-10 05:58:39 +0000 |
| commit | ceee7fb05bad66d3ae295664beb348673681e498 (patch) | |
| tree | 19bd9e9c8c50f7652b8571aff738da522ecfc420 /drivers/media/v4l2-core/v4l2-async.c | |
| parent | media: rcar-csi2: Add support for C-PHY on R-Car V4H (diff) | |
| download | kernel-ceee7fb05bad66d3ae295664beb348673681e498.tar.gz kernel-ceee7fb05bad66d3ae295664beb348673681e498.zip | |
media: v4l: async: Avoid a goto in loop implementation
Replace a goto-based loop by a while loop.
Suggested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-async.c')
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-async.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index f465a0964adf..091e8cf4114b 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -820,20 +820,16 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) if (!v4l2_dev) continue; -again: - asc = v4l2_async_find_match(notifier, sd); - if (!asc) - continue; + while ((asc = v4l2_async_find_match(notifier, sd))) { + ret = v4l2_async_match_notify(notifier, v4l2_dev, sd, + asc); + if (ret) + goto err_unbind; - ret = v4l2_async_match_notify(notifier, v4l2_dev, sd, asc); - if (ret) - goto err_unbind; - - ret = v4l2_async_nf_try_complete(notifier); - if (ret) - goto err_unbind; - - goto again; + ret = v4l2_async_nf_try_complete(notifier); + if (ret) + goto err_unbind; + } } /* None matched, wait for hot-plugging */ |
