Commit 8f9d40d5 authored by Jonas Karlman's avatar Jonas Karlman Committed by Greg Kroah-Hartman

media: rockchip/vpu: Fix/re-order probe-error/remove path

[ Upstream commit fc8670d1 ]

media_device_cleanup() and v4l2_m2m_unregister_media_controller() were
missing in the probe error path.
While at it, re-order calls in the remove path to unregister/cleanup
things in the reverse order they were initialized/registered.
Signed-off-by: default avatarJonas Karlman <jonas@kwiboo.se>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c2d2804b
...@@ -481,10 +481,12 @@ static int rockchip_vpu_probe(struct platform_device *pdev) ...@@ -481,10 +481,12 @@ static int rockchip_vpu_probe(struct platform_device *pdev)
return 0; return 0;
err_video_dev_unreg: err_video_dev_unreg:
if (vpu->vfd_enc) { if (vpu->vfd_enc) {
v4l2_m2m_unregister_media_controller(vpu->m2m_dev);
video_unregister_device(vpu->vfd_enc); video_unregister_device(vpu->vfd_enc);
video_device_release(vpu->vfd_enc); video_device_release(vpu->vfd_enc);
} }
err_m2m_rel: err_m2m_rel:
media_device_cleanup(&vpu->mdev);
v4l2_m2m_release(vpu->m2m_dev); v4l2_m2m_release(vpu->m2m_dev);
err_v4l2_unreg: err_v4l2_unreg:
v4l2_device_unregister(&vpu->v4l2_dev); v4l2_device_unregister(&vpu->v4l2_dev);
...@@ -501,13 +503,13 @@ static int rockchip_vpu_remove(struct platform_device *pdev) ...@@ -501,13 +503,13 @@ static int rockchip_vpu_remove(struct platform_device *pdev)
v4l2_info(&vpu->v4l2_dev, "Removing %s\n", pdev->name); v4l2_info(&vpu->v4l2_dev, "Removing %s\n", pdev->name);
media_device_unregister(&vpu->mdev); media_device_unregister(&vpu->mdev);
v4l2_m2m_unregister_media_controller(vpu->m2m_dev);
v4l2_m2m_release(vpu->m2m_dev);
media_device_cleanup(&vpu->mdev);
if (vpu->vfd_enc) { if (vpu->vfd_enc) {
v4l2_m2m_unregister_media_controller(vpu->m2m_dev);
video_unregister_device(vpu->vfd_enc); video_unregister_device(vpu->vfd_enc);
video_device_release(vpu->vfd_enc); video_device_release(vpu->vfd_enc);
} }
media_device_cleanup(&vpu->mdev);
v4l2_m2m_release(vpu->m2m_dev);
v4l2_device_unregister(&vpu->v4l2_dev); v4l2_device_unregister(&vpu->v4l2_dev);
clk_bulk_unprepare(vpu->variant->num_clocks, vpu->clocks); clk_bulk_unprepare(vpu->variant->num_clocks, vpu->clocks);
pm_runtime_disable(vpu->dev); pm_runtime_disable(vpu->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment