Skip to contentSkip to conversation

mtd: cs42l43: use modern PM macro helpers

PATCH In review Arnd Bergmann 2 participants 3 messages Sep 11, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: cs42l43: use modern PM macro helpers

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS/SET_RUNTIME_PM_OPS macros required enclosing the function definitions in an #ifdef or marking them __maybe_unused:

drivers/mfd/cs42l43.c:1138:12: error: 'cs42l43_runtime_resume' defined but not used [-Werror=unused-function]
1138 | static int cs42l43_runtime_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/cs42l43.c:1124:12: error: 'cs42l43_runtime_suspend' defined but not used [-Werror=unused-function]
 1124 | static int cs42l43_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/cs42l43.c:1106:12: error: 'cs42l43_resume' defined but not used [-Werror=unused-function]
 1106 | static int cs42l43_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~
drivers/mfd/cs42l43.c:1076:12: error: 'cs42l43_suspend' defined but not used [-Werror=unused-function]
 1076 | static int cs42l43_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~

Use the modern replacements to avoid the warnings without those annotations.

Fixes ace6d14481386 ("mfd: cs42l43: Add support for cs42l43 core driver")
---
 drivers/mfd/cs42l43.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/cs42l43.c +2 -2
index 37b23e9bae823..7b6d07cbe6fc6 100644
@@ -1178,8 +1178,8 @@ static int cs42l43_runtime_resume(struct device *dev)
 }
 
 EXPORT_NS_GPL_DEV_PM_OPS(cs42l43_pm_ops, MFD_CS42L43) = {
-	SET_SYSTEM_SLEEP_PM_OPS(cs42l43_suspend, cs42l43_resume)
-	SET_RUNTIME_PM_OPS(cs42l43_runtime_suspend, cs42l43_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(cs42l43_suspend, cs42l43_resume)
+	RUNTIME_PM_OPS(cs42l43_runtime_suspend, cs42l43_runtime_resume, NULL)
 };
 
 MODULE_DESCRIPTION("CS42L43 Core Driver");
Signature · 1 line
2.39.2
#1 lore raw
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS/SET_RUNTIME_PM_OPS macros required enclosing the function definitions in an #ifdef or marking them __maybe_unused:

drivers/mfd/cs42l43.c:1138:12: error: 'cs42l43_runtime_resume' defined but not used [-Werror=unused-function]
1138 | static int cs42l43_runtime_resume(struct device *dev)

Commit title has typo. mtd should be mfd.

#2 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS/SET_RUNTIME_PM_OPS macros required enclosing the function definitions in an #ifdef or marking them __maybe_unused:

<SNIP>

drivers/mfd/cs42l43.c static int cs42l43_runtime_resume(struct device *dev) · line 1183

Quoted 7 lines
  
  EXPORT_NS_GPL_DEV_PM_OPS(cs42l43_pm_ops, MFD_CS42L43) = {
drivers/mfd/cs42l43.c +2 -2
-	SET_SYSTEM_SLEEP_PM_OPS(cs42l43_suspend, cs42l43_resume)
-	SET_RUNTIME_PM_OPS(cs42l43_runtime_suspend, cs42l43_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(cs42l43_suspend, cs42l43_resume)
+	RUNTIME_PM_OPS(cs42l43_runtime_suspend, cs42l43_runtime_resume, NULL)
  };

Charles already sent a patch for this. We're waiting for Lee to merge it.
https://lore.kernel.org/all/[email protected]/