Skip to content

Commit

Permalink
media: st-delta: Fix PM disable depth imbalance in delta_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 94e3dba ]

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: f386509 ("[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>
  • Loading branch information
Yuuoniy authored and gregkh committed Jun 9, 2022
1 parent 8e4e0c4 commit b3e4837
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/platform/sti/delta/delta-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,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 */
Expand All @@ -1876,7 +1876,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);
Expand All @@ -1901,6 +1901,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;
}
Expand Down

0 comments on commit b3e4837

Please sign in to comment.