]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: st-delta: Fix PM disable depth imbalance in delta_probe
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 7 Mar 2022 08:08:59 +0000 (09:08 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:02 +0000 (11:02 +0200)
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: d1972ea9d8a4 ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/st/sti/delta/delta-v4l2.c

index c887a31ebb54057444c8f78ca6f63a310718a128..420ad4d8df5d583877689c18527bb6134fe3e136 100644 (file)
@@ -1859,7 +1859,7 @@ static int delta_probe(struct platform_device *pdev)
        if (ret) {
                dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n",
                        DELTA_PREFIX);
-               goto err;
+               goto err_pm_disable;
        }
 
        /* register all available decoders */
@@ -1873,7 +1873,7 @@ static int delta_probe(struct platform_device *pdev)
        if (ret) {
                dev_err(delta->dev, "%s failed to register V4L2 device\n",
                        DELTA_PREFIX);
-               goto err;
+               goto err_pm_disable;
        }
 
        delta->work_queue = create_workqueue(DELTA_NAME);
@@ -1898,6 +1898,8 @@ err_work_queue:
        destroy_workqueue(delta->work_queue);
 err_v4l2:
        v4l2_device_unregister(&delta->v4l2_dev);
+err_pm_disable:
+       pm_runtime_disable(dev);
 err:
        return ret;
 }