Commit 94e3dba7 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Mauro Carvalho Chehab

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

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: default avatarMiaoqian Lin <linmq006@gmail.com>
Acked-by: default avatarHugues Fruchet <hugues.fruchet@foss.st.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 5c0db68c
...@@ -1859,7 +1859,7 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1859,7 +1859,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 */
...@@ -1873,7 +1873,7 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1873,7 +1873,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);
...@@ -1898,6 +1898,8 @@ static int delta_probe(struct platform_device *pdev) ...@@ -1898,6 +1898,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment