Commit 2430d12c94ff2bafcfe4f65edf7ee5f300d2d9c6

Authored by Alan Stern
Committed by Rafael J. Wysocki
1 parent 9013367339

PM: describe kernel policy regarding wakeup defaults (v. 2)

This patch (as1381b) updates a comment describing the kernel's policy
toward enabling wakeup by default.

It also makes device_set_wakeup_capable() actually do something when
CONFIG_PM isn't enabled.  It's not clear this is necessary; however if
it isn't then device_init_wakeup() and device_can_wakeup() should also
be do-nothing routines.  Furthermore, I don't expect this change to
have any noticeable effect -- but if it does then clearly the old
behavior was wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Showing 1 changed file with 7 additions and 3 deletions Side-by-side Diff

include/linux/pm_wakeup.h
... ... @@ -29,8 +29,11 @@
29 29  
30 30 #ifdef CONFIG_PM
31 31  
32   -/* changes to device_may_wakeup take effect on the next pm state change.
33   - * by default, devices should wakeup if they can.
  32 +/* Changes to device_may_wakeup take effect on the next pm state change.
  33 + *
  34 + * By default, most devices should leave wakeup disabled. The exceptions
  35 + * are devices that everyone expects to be wakeup sources: keyboards,
  36 + * power buttons, possibly network interfaces, etc.
34 37 */
35 38 static inline void device_init_wakeup(struct device *dev, bool val)
36 39 {
... ... @@ -59,7 +62,7 @@
59 62  
60 63 #else /* !CONFIG_PM */
61 64  
62   -/* For some reason the next two routines work even without CONFIG_PM */
  65 +/* For some reason the following routines work even without CONFIG_PM */
63 66 static inline void device_init_wakeup(struct device *dev, bool val)
64 67 {
65 68 dev->power.can_wakeup = val;
... ... @@ -67,6 +70,7 @@
67 70  
68 71 static inline void device_set_wakeup_capable(struct device *dev, bool capable)
69 72 {
  73 + dev->power.can_wakeup = capable;
70 74 }
71 75  
72 76 static inline bool device_can_wakeup(struct device *dev)