mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
media: hantro: Fix probe func error path
[ Upstream commit37af43b250
] If clocks for some reason couldn't be enabled, probe function returns immediately, without disabling PM. This obviously leaves PM ref counters unbalanced. Fix that by jumping to appropriate error path, so effects of PM functions are reversed. Fixes:775fec6900
("media: add Rockchip VPU JPEG encoder driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
26cf595abd
commit
ba7d5b3e33
1 changed files with 2 additions and 1 deletions
|
@ -823,7 +823,7 @@ static int hantro_probe(struct platform_device *pdev)
|
|||
ret = clk_bulk_prepare(vpu->variant->num_clocks, vpu->clocks);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to prepare clocks\n");
|
||||
return ret;
|
||||
goto err_pm_disable;
|
||||
}
|
||||
|
||||
ret = v4l2_device_register(&pdev->dev, &vpu->v4l2_dev);
|
||||
|
@ -879,6 +879,7 @@ static int hantro_probe(struct platform_device *pdev)
|
|||
v4l2_device_unregister(&vpu->v4l2_dev);
|
||||
err_clk_unprepare:
|
||||
clk_bulk_unprepare(vpu->variant->num_clocks, vpu->clocks);
|
||||
err_pm_disable:
|
||||
pm_runtime_dont_use_autosuspend(vpu->dev);
|
||||
pm_runtime_disable(vpu->dev);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue