Skip to contentSkip to conversation

clk: imx: imx8mp: Switch to RUNTIME_PM_OPS()

PATCH Applied Fabio Estevam 4 participants 4 messages Apr 29, 2024 – May 2, 2024

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 clk: imx: imx8mp: Switch to RUNTIME_PM_OPS()

From: Fabio Estevam <[email protected]>

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

---
 drivers/clk/imx/clk-imx8mp-audiomix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/imx/clk-imx8mp-audiomix.c +3 -3
index 574a032309c1..6a9b48b20cd6 100644
@@ -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),
 	},
 };
 
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines

Subject: [PATCH] clk: imx: imx8mp: Switch to RUNTIME_PM_OPS()

From: Fabio Estevam <[email protected]>

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

Closes:
https://lore.ke/
rnel.org%2Flinux- clk%2FCA%2BG9fYuP7S%2Ba89Ep5g5_Ad69EMwRkJ8nM%2BMMTzbEcP%2B 6H2oMXQ%40mail.gmail.com%2FT%2F%23u&data=05%7C02%7Cpeng.fan% 40nxp.com%7C9d12d569610c457011aa08dc6895a8e2%7C686ea1d3bc2b4c 6fa92cd99c5c301635%7C0%7C0%7C638500239186820103%7CUnknown%7 CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwi LCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=EcUHmggtxNEkO3DFCbInsDhnk MErp58G6wG4PGJ0lws%3D&reserved=0

Quoted 3 lines
Fixes 1496dd413b2e ("clk: imx: imx8mp: Add pm_runtime support for

power saving")

Quoted 33 lines
---
 drivers/clk/imx/clk-imx8mp-audiomix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/imx/clk- renamed from drivers/clk/imx/clk-imx8mp-audiomix.c +0 -0

imx8mp-audiomix.c
index 574a032309c1..6a9b48b20cd6 100644

drivers/clk/imx/clk-imx8mp-audiomix.c +3 -4
@@ -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),
      },
 };
 
--

2.34.1

Applied
#2 lore raw
In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

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:

[...]

Applied, thanks!

[1/1] clk: imx: imx8mp: Switch to RUNTIME_PM_OPS()

      commit: 57939f392371fc93c203b781807c951018c29606

Best regards,

Signature · 1 line
Abel Vesa <[email protected]>
Tested-by Linux Kernel Functional Testing on v1 1/1
#3 lore raw
In reply to Fabio Estevam
Quoted 20 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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)

Quoted 7 lines
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Thanks for the fix patch.

Quoted 29 lines
---
 drivers/clk/imx/clk-imx8mp-audiomix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/imx/clk-imx8mp-audiomix.c +3 -4
index 574a032309c1..6a9b48b20cd6 100644
@@ -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),
        },
 };
 
--
Quoted 1 line

2.34.1

--
Linaro LKFT
https://lkft.linaro.org