]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rzg2l-cru: csi2: Use devm_pm_runtime_enable()
authorTommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Fri, 11 Apr 2025 17:05:33 +0000 (19:05 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 23 Apr 2025 08:55:53 +0000 (10:55 +0200)
Use newly added devm_pm_runtime_enable() into rzg2l_csi2_probe() and
drop error path accordingly. Drop also unnecessary pm_runtime_disable()
from rzg2l_csi2_remove().

Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://lore.kernel.org/r/20250411170624.472257-6-tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c

index 948f1917b830d6a224632b4e0cda370871655e68..4ccf7c5ea58b0192020b4428e95abf787f3b7eb9 100644 (file)
@@ -805,11 +805,13 @@ static int rzg2l_csi2_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       pm_runtime_enable(dev);
+       ret = devm_pm_runtime_enable(dev);
+       if (ret)
+               return ret;
 
        ret = rzg2l_validate_csi2_lanes(csi2);
        if (ret)
-               goto error_pm;
+               return ret;
 
        csi2->subdev.dev = dev;
        v4l2_subdev_init(&csi2->subdev, &rzg2l_csi2_subdev_ops);
@@ -834,7 +836,7 @@ static int rzg2l_csi2_probe(struct platform_device *pdev)
        ret = media_entity_pads_init(&csi2->subdev.entity, ARRAY_SIZE(csi2->pads),
                                     csi2->pads);
        if (ret)
-               goto error_pm;
+               return ret;
 
        ret = v4l2_subdev_init_finalize(&csi2->subdev);
        if (ret < 0)
@@ -852,8 +854,6 @@ error_async:
        v4l2_async_nf_unregister(&csi2->notifier);
        v4l2_async_nf_cleanup(&csi2->notifier);
        media_entity_cleanup(&csi2->subdev.entity);
-error_pm:
-       pm_runtime_disable(dev);
 
        return ret;
 }
@@ -867,7 +867,6 @@ static void rzg2l_csi2_remove(struct platform_device *pdev)
        v4l2_async_unregister_subdev(&csi2->subdev);
        v4l2_subdev_cleanup(&csi2->subdev);
        media_entity_cleanup(&csi2->subdev.entity);
-       pm_runtime_disable(&pdev->dev);
 }
 
 static int rzg2l_csi2_pm_runtime_suspend(struct device *dev)