diff options
author | David Brownell <david-b@pacbell.net> | 2006-05-16 20:03:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 15:40:49 -0400 |
commit | fd869db6eb1ea0ffe251e53a113dbf259400f4f6 (patch) | |
tree | bce8f3d2316c3e257dfe5f6e5fa024abffa0c03d /drivers/base | |
parent | 1e724845034eb898c97dc6636207f0a231af9432 (diff) |
[PATCH] Driver core: PM_DEBUG device suspend() messages become informative
This makes the driver model PM suspend debug messages more useful, by
(a) explaining what event is being sent, since not all suspend()
requests mean the same thing;
(b) reporting when a PM_EVENT_SUSPEND call is allowing the device
to issue wakeup events.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/suspend.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 2a769cc6f5f9..1a1fe43a3057 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
@@ -29,6 +29,15 @@ | |||
29 | * lists. This way, the ancestors will be accessed before their descendents. | 29 | * lists. This way, the ancestors will be accessed before their descendents. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | static inline char *suspend_verb(u32 event) | ||
33 | { | ||
34 | switch (event) { | ||
35 | case PM_EVENT_SUSPEND: return "suspend"; | ||
36 | case PM_EVENT_FREEZE: return "freeze"; | ||
37 | default: return "(unknown suspend event)"; | ||
38 | } | ||
39 | } | ||
40 | |||
32 | 41 | ||
33 | /** | 42 | /** |
34 | * suspend_device - Save state of one device. | 43 | * suspend_device - Save state of one device. |
@@ -57,7 +66,13 @@ int suspend_device(struct device * dev, pm_message_t state) | |||
57 | dev->power.prev_state = dev->power.power_state; | 66 | dev->power.prev_state = dev->power.power_state; |
58 | 67 | ||
59 | if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) { | 68 | if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) { |
60 | dev_dbg(dev, "suspending\n"); | 69 | dev_dbg(dev, "%s%s\n", |
70 | suspend_verb(state.event), | ||
71 | ((state.event == PM_EVENT_SUSPEND) | ||
72 | && device_may_wakeup(dev)) | ||
73 | ? ", may wakeup" | ||
74 | : "" | ||
75 | ); | ||
61 | error = dev->bus->suspend(dev, state); | 76 | error = dev->bus->suspend(dev, state); |
62 | suspend_report_result(dev->bus->suspend, error); | 77 | suspend_report_result(dev->bus->suspend, error); |
63 | } | 78 | } |