Skip to content

Commit c62362e

Browse files
andy-shevrafaeljw
authored andcommitted
Documentation: PM: Discourage use of deprecated macros
The Documentation refers to some deprecated macros. Update those parts accordingly. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Changelog edit ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a712f03 commit c62362e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Documentation/power/pci.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -979,18 +979,17 @@ subsections can be defined as a separate function, it often is convenient to
979979
point two or more members of struct dev_pm_ops to the same routine. There are
980980
a few convenience macros that can be used for this purpose.
981981

982-
The SIMPLE_DEV_PM_OPS macro declares a struct dev_pm_ops object with one
982+
The DEFINE_SIMPLE_DEV_PM_OPS() declares a struct dev_pm_ops object with one
983983
suspend routine pointed to by the .suspend(), .freeze(), and .poweroff()
984984
members and one resume routine pointed to by the .resume(), .thaw(), and
985985
.restore() members. The other function pointers in this struct dev_pm_ops are
986986
unset.
987987

988-
The UNIVERSAL_DEV_PM_OPS macro is similar to SIMPLE_DEV_PM_OPS, but it
989-
additionally sets the .runtime_resume() pointer to the same value as
990-
.resume() (and .thaw(), and .restore()) and the .runtime_suspend() pointer to
991-
the same value as .suspend() (and .freeze() and .poweroff()).
988+
The DEFINE_RUNTIME_DEV_PM_OPS() is similar to DEFINE_SIMPLE_DEV_PM_OPS(), but it
989+
additionally sets the .runtime_resume() pointer to pm_runtime_force_resume()
990+
and the .runtime_suspend() pointer to pm_runtime_force_suspend().
992991

993-
The SET_SYSTEM_SLEEP_PM_OPS can be used inside of a declaration of struct
992+
The SYSTEM_SLEEP_PM_OPS() can be used inside of a declaration of struct
994993
dev_pm_ops to indicate that one suspend routine is to be pointed to by the
995994
.suspend(), .freeze(), and .poweroff() members and one resume routine is to
996995
be pointed to by the .resume(), .thaw(), and .restore() members.

Documentation/power/runtime_pm.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ subsystem-level dev_pm_ops structure.
811811

812812
Device drivers that wish to use the same function as a system suspend, freeze,
813813
poweroff and runtime suspend callback, and similarly for system resume, thaw,
814-
restore, and runtime resume, can achieve this with the help of the
815-
UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
814+
restore, and runtime resume, can achieve similar behaviour with the help of the
815+
DEFINE_RUNTIME_DEV_PM_OPS() defined in include/linux/pm_runtime.h (possibly setting its
816816
last argument to NULL).
817817

818818
8. "No-Callback" Devices

0 commit comments

Comments
 (0)