]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS()
authorFabio Estevam <festevam@denx.de>
Wed, 26 Jun 2024 23:07:02 +0000 (20:07 -0300)
committerNeil Armstrong <neil.armstrong@linaro.org>
Fri, 13 Sep 2024 08:10:16 +0000 (10:10 +0200)
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: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240626230704.708234-4-festevam@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626230704.708234-4-festevam@gmail.com
drivers/gpu/drm/bridge/samsung-dsim.c

index e7e53a9e42afbd21be9420afefbb0fe1a33a086c..73ccf21ae446bf7a14c4fa17d9318bc1d69170b7 100644 (file)
@@ -2043,7 +2043,7 @@ void samsung_dsim_remove(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(samsung_dsim_remove);
 
-static int __maybe_unused samsung_dsim_suspend(struct device *dev)
+static int samsung_dsim_suspend(struct device *dev)
 {
        struct samsung_dsim *dsi = dev_get_drvdata(dev);
        const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -2073,7 +2073,7 @@ static int __maybe_unused samsung_dsim_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused samsung_dsim_resume(struct device *dev)
+static int samsung_dsim_resume(struct device *dev)
 {
        struct samsung_dsim *dsi = dev_get_drvdata(dev);
        const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -2108,7 +2108,7 @@ err_clk:
 }
 
 const struct dev_pm_ops samsung_dsim_pm_ops = {
-       SET_RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
+       RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
        SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
                                pm_runtime_force_resume)
 };
@@ -2142,7 +2142,7 @@ static struct platform_driver samsung_dsim_driver = {
        .remove_new = samsung_dsim_remove,
        .driver = {
                   .name = "samsung-dsim",
-                  .pm = &samsung_dsim_pm_ops,
+                  .pm = pm_ptr(&samsung_dsim_pm_ops),
                   .of_match_table = samsung_dsim_of_match,
        },
 };