media: imx-mipi-csis: Switch to RUNTIME_PM_OPS()
authorFabio Estevam <festevam@denx.de>
Wed, 7 Aug 2024 18:26:09 +0000 (15:26 -0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 23 Aug 2024 13:55:30 +0000 (16:55 +0300)
Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS()
alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the
compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240807182610.81244-1-festevam@gmail.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/media/platform/nxp/imx-mipi-csis.c

index e0b1d3adda105dce78b844b382112c9ee085dd08..44e1402e8be198bb8d68aa172a9ebd6119fbcb7c 100644 (file)
@@ -1347,7 +1347,7 @@ err_parse:
  * Suspend/resume
  */
 
-static int __maybe_unused mipi_csis_runtime_suspend(struct device *dev)
+static int mipi_csis_runtime_suspend(struct device *dev)
 {
        struct v4l2_subdev *sd = dev_get_drvdata(dev);
        struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
@@ -1362,7 +1362,7 @@ static int __maybe_unused mipi_csis_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused mipi_csis_runtime_resume(struct device *dev)
+static int mipi_csis_runtime_resume(struct device *dev)
 {
        struct v4l2_subdev *sd = dev_get_drvdata(dev);
        struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
@@ -1382,8 +1382,8 @@ static int __maybe_unused mipi_csis_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops mipi_csis_pm_ops = {
-       SET_RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume,
-                          NULL)
+       RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume,
+                      NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -1574,7 +1574,7 @@ static struct platform_driver mipi_csis_driver = {
        .driver         = {
                .of_match_table = mipi_csis_of_match,
                .name           = CSIS_DRIVER_NAME,
-               .pm             = &mipi_csis_pm_ops,
+               .pm             = pm_ptr(&mipi_csis_pm_ops),
        },
 };