summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-06-14 21:10:36 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-17 12:24:53 +0200
commit13c9810281f8b24af9b7712cd84a1fce61843e93 (patch)
treeff3f88015a39333225b36b354d8195b1cc99e166 /drivers/media
parentmedia: rkisp1: Enable compilation on ARCH_MXC (diff)
downloadlinux-13c9810281f8b24af9b7712cd84a1fce61843e93.tar.xz
linux-13c9810281f8b24af9b7712cd84a1fce61843e93.zip
media: rkisp1: Disable runtime PM in probe error path
If the v4l2_device_register() call fails, runtime PM is left enabled. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index 97d569968285..248f0172ca62 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -523,7 +523,7 @@ static int rkisp1_probe(struct platform_device *pdev)
ret = v4l2_device_register(rkisp1->dev, &rkisp1->v4l2_dev);
if (ret)
- return ret;
+ goto err_pm_runtime_disable;
ret = media_device_register(&rkisp1->media_dev);
if (ret) {
@@ -543,6 +543,7 @@ err_unreg_media_dev:
media_device_unregister(&rkisp1->media_dev);
err_unreg_v4l2_dev:
v4l2_device_unregister(&rkisp1->v4l2_dev);
+err_pm_runtime_disable:
pm_runtime_disable(&pdev->dev);
return ret;
}