PM / Runtime: Add macro to test for runtime PM events
This patch (as1482) adds a macro for testing whether or not a pm_message value represents an autosuspend or autoresume (i.e., a runtime PM) event. Encapsulating this notion seems preferable to open-coding the test all over the place. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
311aab73d2
commit
5b1b0b812a
@@ -366,6 +366,8 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
|
||||
#define PMSG_AUTO_RESUME ((struct pm_message) \
|
||||
{ .event = PM_EVENT_AUTO_RESUME, })
|
||||
|
||||
#define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0)
|
||||
|
||||
/**
|
||||
* Device run-time power management status.
|
||||
*
|
||||
|
Reference in New Issue
Block a user