diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2021-01-04 23:34:41 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-12 20:07:31 +0300 |
commit | 7c720d77aae38b79f5bc3a0e0c82dcf8139aaf07 (patch) | |
tree | 4c8411aee0dca996c9af09aea9fe22aecaaf365d /drivers | |
parent | 89b14485caa4b7b2eaf70be0064f0978e68ebeee (diff) | |
download | linux-7c720d77aae38b79f5bc3a0e0c82dcf8139aaf07.tar.xz |
media: imx: Clean capture unregister
No locking is needed to call video_unregister_device(). Drop it.
Also, drop the superfluous video_is_registered() call, which is
done by video_unregister_device(), and re-order media_entity_cleanup()
and video_unregister_device() calls.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/imx/imx-media-capture.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index c1931eb2540e..e10ce103a5b4 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -816,14 +816,8 @@ void imx_media_capture_device_unregister(struct imx_media_video_dev *vdev) struct capture_priv *priv = to_capture_priv(vdev); struct video_device *vfd = priv->vdev.vfd; - mutex_lock(&priv->mutex); - - if (video_is_registered(vfd)) { - video_unregister_device(vfd); - media_entity_cleanup(&vfd->entity); - } - - mutex_unlock(&priv->mutex); + media_entity_cleanup(&vfd->entity); + video_unregister_device(vfd); } EXPORT_SYMBOL_GPL(imx_media_capture_device_unregister); |