]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: renesas: ceu: Convert to RUNTIME_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Jul 2025 19:16:10 +0000 (21:16 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 17 Sep 2025 10:14:05 +0000 (12:14 +0200)
Convert the Renesas Capture Engine Unit driver from SET_RUNTIME_PM_OPS()
to RUNTIME_PM_OPS() and pm_ptr().  This lets us drop the __maybe_unused
annotations from its runtime suspend and resume callbacks, and reduces
kernel size in case CONFIG_PM is disabled.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/renesas/renesas-ceu.c

index 8cceafe491b1bec6c10ced8e0336b5575db88297..deed49d0fb10e0d7834a30293f6c1ede7055409a 100644 (file)
@@ -1048,7 +1048,7 @@ static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
 /*
  * ceu_runtime_resume() - soft-reset the interface and turn sensor power on.
  */
-static int __maybe_unused ceu_runtime_resume(struct device *dev)
+static int ceu_runtime_resume(struct device *dev)
 {
        struct ceu_device *ceudev = dev_get_drvdata(dev);
        struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1064,7 +1064,7 @@ static int __maybe_unused ceu_runtime_resume(struct device *dev)
  * ceu_runtime_suspend() - disable capture and interrupts and soft-reset.
  *                        Turn sensor power off.
  */
-static int __maybe_unused ceu_runtime_suspend(struct device *dev)
+static int ceu_runtime_suspend(struct device *dev)
 {
        struct ceu_device *ceudev = dev_get_drvdata(dev);
        struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1709,15 +1709,13 @@ static void ceu_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops ceu_pm_ops = {
-       SET_RUNTIME_PM_OPS(ceu_runtime_suspend,
-                          ceu_runtime_resume,
-                          NULL)
+       RUNTIME_PM_OPS(ceu_runtime_suspend, ceu_runtime_resume, NULL)
 };
 
 static struct platform_driver ceu_driver = {
        .driver         = {
                .name   = DRIVER_NAME,
-               .pm     = &ceu_pm_ops,
+               .pm     = pm_ptr(&ceu_pm_ops),
                .of_match_table = of_match_ptr(ceu_of_match),
        },
        .probe          = ceu_probe,