aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2023-02-13 16:50:05 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-02-13 19:17:34 +0100
commit41a337b40e983db4f0e1602308109f2b93687a06 (patch)
treead1db4cae5512d9a055f773fd7d8c4f846b3d0c2
parentPM: runtime: Document that force_suspend() is incompatible with SMART_SUSPEND (diff)
downloadwireguard-linux-41a337b40e983db4f0e1602308109f2b93687a06.tar.xz
wireguard-linux-41a337b40e983db4f0e1602308109f2b93687a06.zip
PM: Add EXPORT macros for exporting PM functions
Add a pair of macros for exporting functions only if CONFIG_PM is enabled. The naming follows the style of the standard EXPORT_SYMBOL_*() macros that they replace. Sometimes a module wants to export PM functions directly to other drivers, not a complete struct dev_pm_ops. A typical example is where a core library exports the generic (shared) implementation and calling code wraps one or more of these in custom code. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--include/linux/pm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 93cd34f00822..035d9649eba4 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -379,9 +379,13 @@ const struct dev_pm_ops name = { \
const struct dev_pm_ops name; \
__EXPORT_SYMBOL(name, sec, ns); \
const struct dev_pm_ops name
+#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name)
+#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns)
#else
#define _EXPORT_DEV_PM_OPS(name, sec, ns) \
static __maybe_unused const struct dev_pm_ops __static_##name
+#define EXPORT_PM_FN_GPL(name)
+#define EXPORT_PM_FN_NS_GPL(name, ns)
#endif
#define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "")