提交 5d350560 编写于 作者: M Miaoqian Lin 提交者: Zheng Zengkai

media: st-delta: Fix PM disable depth imbalance in delta_probe

stable inclusion
from stable-v5.10.121
commit b3e483735847c7ae2c10a685624eb13c1b6bef63
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b3e483735847c7ae2c10a685624eb13c1b6bef63

--------------------------------

[ Upstream commit 94e3dba7 ]

The pm_runtime_enable will decrease power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().

Fixes: f386509e ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Acked-by: NHugues Fruchet <hugues.fruchet@foss.st.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 dc0fa32e
...@@ -1862,7 +1862,7 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1862,7 +1862,7 @@ static int delta_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n", dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n",
DELTA_PREFIX); DELTA_PREFIX);
goto err; goto err_pm_disable;
} }
/* register all available decoders */ /* register all available decoders */
...@@ -1876,7 +1876,7 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1876,7 +1876,7 @@ static int delta_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(delta->dev, "%s failed to register V4L2 device\n", dev_err(delta->dev, "%s failed to register V4L2 device\n",
DELTA_PREFIX); DELTA_PREFIX);
goto err; goto err_pm_disable;
} }
delta->work_queue = create_workqueue(DELTA_NAME); delta->work_queue = create_workqueue(DELTA_NAME);
...@@ -1901,6 +1901,8 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1901,6 +1901,8 @@ static int delta_probe(struct platform_device *pdev)
destroy_workqueue(delta->work_queue); destroy_workqueue(delta->work_queue);
err_v4l2: err_v4l2:
v4l2_device_unregister(&delta->v4l2_dev); v4l2_device_unregister(&delta->v4l2_dev);
err_pm_disable:
pm_runtime_disable(dev);
err: err:
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册