]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: imx: imx8mp: Switch to RUNTIME_PM_OPS()
authorFabio Estevam <festevam@denx.de>
Mon, 29 Apr 2024 21:45:02 +0000 (18:45 -0300)
committerAbel Vesa <abel.vesa@linaro.org>
Wed, 1 May 2024 11:36:16 +0000 (14:36 +0300)
Replace SET_RUNTIME_PM_OPS() with its modern alternative RUNTIME_PM_OPS().

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

This fixes the following s390 allmodconfig build errors:

drivers/clk/imx/clk-imx8mp-audiomix.c:363:12: error:
'clk_imx8mp_audiomix_runtime_resume' defined but not used
[-Werror=unused-function]
  363 | static int clk_imx8mp_audiomix_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/imx/clk-imx8mp-audiomix.c:356:12: error:
'clk_imx8mp_audiomix_runtime_suspend' defined but not used
[-Werror=unused-function]
  356 | static int clk_imx8mp_audiomix_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Closes: https://lore.kernel.org/linux-clk/CA+G9fYuP7S+a89Ep5g5_Ad69EMwRkJ8nM+MMTzbEcP+6H2oMXQ@mail.gmail.com/T/#u
Fixes: 1496dd413b2e ("clk: imx: imx8mp: Add pm_runtime support for power saving")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20240429214502.1363592-1-festevam@gmail.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
drivers/clk/imx/clk-imx8mp-audiomix.c

index 574a032309c1b45ad9bff247ab0b49145d4751ac..6a9b48b20cd6038410eb535ca8d490d133498d66 100644 (file)
@@ -368,8 +368,8 @@ static int clk_imx8mp_audiomix_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops clk_imx8mp_audiomix_pm_ops = {
-       SET_RUNTIME_PM_OPS(clk_imx8mp_audiomix_runtime_suspend,
-                          clk_imx8mp_audiomix_runtime_resume, NULL)
+       RUNTIME_PM_OPS(clk_imx8mp_audiomix_runtime_suspend,
+                      clk_imx8mp_audiomix_runtime_resume, NULL)
        SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
                                      pm_runtime_force_resume)
 };
@@ -386,7 +386,7 @@ static struct platform_driver clk_imx8mp_audiomix_driver = {
        .driver = {
                .name = "imx8mp-audio-blk-ctrl",
                .of_match_table = clk_imx8mp_audiomix_of_match,
-               .pm = &clk_imx8mp_audiomix_pm_ops,
+               .pm = pm_ptr(&clk_imx8mp_audiomix_pm_ops),
        },
 };