public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] PM: Discard runtime_xx() handles using pm_ptr()
@ 2025-02-20  8:03 Raag Jadav
  2025-02-20 10:35 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Raag Jadav @ 2025-02-20  8:03 UTC (permalink / raw)
  To: rafael, paul, andriy.shevchenko; +Cc: linux-pm, linux-kernel, Raag Jadav

Discard runtime_xx() handles in RUNTIME_PM_OPS() using pm_ptr() macro
and drop unnecessary CONFIG_PM ifdeffery.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
PS: I'm not very confident about this but thought I'd give it a try.

 include/linux/pm.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index 78855d794342..416561c60e81 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -334,9 +334,9 @@ struct dev_pm_ops {
 	.restore_noirq = pm_sleep_ptr(resume_fn),
 
 #define RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
-	.runtime_suspend = suspend_fn, \
-	.runtime_resume = resume_fn, \
-	.runtime_idle = idle_fn,
+	.runtime_suspend = pm_ptr(suspend_fn), \
+	.runtime_resume = pm_ptr(resume_fn), \
+	.runtime_idle = pm_ptr(idle_fn),
 
 #ifdef CONFIG_PM_SLEEP
 #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
@@ -359,12 +359,8 @@ struct dev_pm_ops {
 #define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
 #endif
 
-#ifdef CONFIG_PM
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
 	RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
-#else
-#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
-#endif
 
 #define _DEFINE_DEV_PM_OPS(name, \
 			   suspend_fn, resume_fn, \
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-20 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20  8:03 [PATCH v1] PM: Discard runtime_xx() handles using pm_ptr() Raag Jadav
2025-02-20 10:35 ` kernel test robot
2025-02-20 11:27 ` kernel test robot
2025-02-20 12:15 ` Paul Cercueil
2025-02-20 12:54   ` Raag Jadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox