lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 072/218] media: st-delta: Fix PM disable depth imbalance in delta_probe
    Date
    From: Miaoqian Lin <linmq006@gmail.com>

    [ Upstream commit 94e3dba710fe0afc772172305444250023fc2d30 ]

    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: f386509e4959 ("[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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/media/platform/sti/delta/delta-v4l2.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
    index 7c925f309158..a489d0d17989 100644
    --- a/drivers/media/platform/sti/delta/delta-v4l2.c
    +++ b/drivers/media/platform/sti/delta/delta-v4l2.c
    @@ -1880,7 +1880,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 */
    @@ -1894,7 +1894,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);
    @@ -1919,6 +1919,8 @@ static int delta_probe(struct platform_device *pdev)
    destroy_workqueue(delta->work_queue);
    err_v4l2:
    v4l2_device_unregister(&delta->v4l2_dev);
    +err_pm_disable:
    + pm_runtime_disable(dev);
    err:
    return ret;
    }
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-06-13 12:48    [W:2.865 / U:0.276 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site