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:
@@ -1009,7 +1009,7 @@ static int sierra_suspend(struct usb_serial *serial, pm_message_t message)
|
||||
struct sierra_intf_private *intfdata;
|
||||
int b;
|
||||
|
||||
if (message.event & PM_EVENT_AUTO) {
|
||||
if (PMSG_IS_AUTO(message)) {
|
||||
intfdata = serial->private;
|
||||
spin_lock_irq(&intfdata->susp_lock);
|
||||
b = intfdata->in_flight;
|
||||
|
Reference in New Issue
Block a user