Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28294
b: refs/heads/master
c: fd869db
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent d4361f8 commit 1a17837
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e724845034eb898c97dc6636207f0a231af9432
refs/heads/master: fd869db6eb1ea0ffe251e53a113dbf259400f4f6
17 changes: 16 additions & 1 deletion trunk/drivers/base/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
* lists. This way, the ancestors will be accessed before their descendents.
*/

static inline char *suspend_verb(u32 event)
{
switch (event) {
case PM_EVENT_SUSPEND: return "suspend";
case PM_EVENT_FREEZE: return "freeze";
default: return "(unknown suspend event)";
}
}


/**
* suspend_device - Save state of one device.
Expand Down Expand Up @@ -57,7 +66,13 @@ int suspend_device(struct device * dev, pm_message_t state)
dev->power.prev_state = dev->power.power_state;

if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) {
dev_dbg(dev, "suspending\n");
dev_dbg(dev, "%s%s\n",
suspend_verb(state.event),
((state.event == PM_EVENT_SUSPEND)
&& device_may_wakeup(dev))
? ", may wakeup"
: ""
);
error = dev->bus->suspend(dev, state);
suspend_report_result(dev->bus->suspend, error);
}
Expand Down

0 comments on commit 1a17837

Please sign in to comment.