Skip to content

Commit 41a337b

Browse files
rfvirgilrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 450316d commit 41a337b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/pm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,13 @@ const struct dev_pm_ops name = { \
379379
const struct dev_pm_ops name; \
380380
__EXPORT_SYMBOL(name, sec, ns); \
381381
const struct dev_pm_ops name
382+
#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name)
383+
#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns)
382384
#else
383385
#define _EXPORT_DEV_PM_OPS(name, sec, ns) \
384386
static __maybe_unused const struct dev_pm_ops __static_##name
387+
#define EXPORT_PM_FN_GPL(name)
388+
#define EXPORT_PM_FN_NS_GPL(name, ns)
385389
#endif
386390

387391
#define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "")

0 commit comments

Comments
 (0)