]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/bridge: imx8qm-ldb: Switch to RUNTIME_PM_OPS()
authorFabio Estevam <festevam@denx.de>
Wed, 26 Jun 2024 23:07:00 +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-2-festevam@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626230704.708234-2-festevam@gmail.com
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c

index 21471a9a28b22082fc38656c4f24d707ee7c19ae..c879e37f5811fa30616bf75b4de23abd8ac88f58 100644 (file)
@@ -542,12 +542,12 @@ static void imx8qm_ldb_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 }
 
-static int __maybe_unused imx8qm_ldb_runtime_suspend(struct device *dev)
+static int imx8qm_ldb_runtime_suspend(struct device *dev)
 {
        return 0;
 }
 
-static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev)
+static int imx8qm_ldb_runtime_resume(struct device *dev)
 {
        struct imx8qm_ldb *imx8qm_ldb = dev_get_drvdata(dev);
        struct ldb *ldb = &imx8qm_ldb->base;
@@ -559,8 +559,7 @@ static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops imx8qm_ldb_pm_ops = {
-       SET_RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend,
-                          imx8qm_ldb_runtime_resume, NULL)
+       RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend, imx8qm_ldb_runtime_resume, NULL)
 };
 
 static const struct of_device_id imx8qm_ldb_dt_ids[] = {
@@ -573,7 +572,7 @@ static struct platform_driver imx8qm_ldb_driver = {
        .probe  = imx8qm_ldb_probe,
        .remove_new = imx8qm_ldb_remove,
        .driver = {
-               .pm = &imx8qm_ldb_pm_ops,
+               .pm = pm_ptr(&imx8qm_ldb_pm_ops),
                .name = DRIVER_NAME,
                .of_match_table = imx8qm_ldb_dt_ids,
        },