]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rzg2l-cru: rzg2l-core: Use devm_pm_runtime_enable()
authorTommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Fri, 11 Apr 2025 17:05:35 +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_cru_probe() and
drop unnecessary pm_runtime_disable() from rzg2l_cru_probe() and
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-8-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-core.c

index 70fed0ce45ea0afb6cd66f14a77bd305f4bf6388..eed9d2bd0841449f0c5ca106e0183721f11a08c4 100644 (file)
@@ -287,7 +287,9 @@ static int rzg2l_cru_probe(struct platform_device *pdev)
 
        cru->num_buf = RZG2L_CRU_HW_BUFFER_DEFAULT;
        pm_suspend_ignore_children(dev, true);
-       pm_runtime_enable(dev);
+       ret = devm_pm_runtime_enable(dev);
+       if (ret)
+               goto error_dma_unregister;
 
        ret = rzg2l_cru_media_init(cru);
        if (ret)
@@ -297,7 +299,6 @@ static int rzg2l_cru_probe(struct platform_device *pdev)
 
 error_dma_unregister:
        rzg2l_cru_dma_unregister(cru);
-       pm_runtime_disable(dev);
 
        return ret;
 }
@@ -306,8 +307,6 @@ static void rzg2l_cru_remove(struct platform_device *pdev)
 {
        struct rzg2l_cru_dev *cru = platform_get_drvdata(pdev);
 
-       pm_runtime_disable(&pdev->dev);
-
        v4l2_async_nf_unregister(&cru->notifier);
        v4l2_async_nf_cleanup(&cru->notifier);