media: driver: hva: add pm_runtime_disable in the error handling code of hva_hw_probe
In the error handling code of hva_hw_probe, it fails to invoke pm_runtime_disable in many error sites. Fix this by adding a label err_disable with pm_runtime_disable and adjust one goto from label err_clk to err_disable. Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
9175fb663a
commit
fb394f3fc8
1 changed files with 3 additions and 1 deletions
|
@ -385,7 +385,7 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
|
||||||
ret = pm_runtime_resume_and_get(dev);
|
ret = pm_runtime_resume_and_get(dev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev, "%s failed to set PM\n", HVA_PREFIX);
|
dev_err(dev, "%s failed to set PM\n", HVA_PREFIX);
|
||||||
goto err_clk;
|
goto err_disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check IP hardware version */
|
/* check IP hardware version */
|
||||||
|
@ -403,6 +403,8 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
|
||||||
|
|
||||||
err_pm:
|
err_pm:
|
||||||
pm_runtime_put(dev);
|
pm_runtime_put(dev);
|
||||||
|
err_disable:
|
||||||
|
pm_runtime_disable(dev);
|
||||||
err_clk:
|
err_clk:
|
||||||
if (hva->clk)
|
if (hva->clk)
|
||||||
clk_unprepare(hva->clk);
|
clk_unprepare(hva->clk);
|
||||||
|
|
Loading…
Add table
Reference in a new issue