diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-08-07 21:06:12 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-21 21:15:36 +0400 |
commit | 3b98aeaf3a75f544dc945694f4fcf6e1c4bab89d (patch) | |
tree | bebaa8c3353ba9e7d5142dc73c767dc030bca7e3 /drivers/base/power/power.h | |
parent | 7c2250352e11bf956c4cfa20b01ae6ba72882788 (diff) | |
download | linux-3b98aeaf3a75f544dc945694f4fcf6e1c4bab89d.tar.xz |
PM: don't skip device PM init when CONFIG_PM_SLEEP isn't set and CONFIG_PM is set
This patch (as1124) fixes a couple of bugs in the PM core. The new
dev->power.status field should be initialized regardless of whether
CONFIG_PM_SLEEP is enabled, and similarly dpm_sysfs_add() should be
called whenever CONFIG_PM is enabled.
The patch separates out the call to dpm_sysfs_add() from the call to
device_pm_add(). As a result device_pm_add() can no longer return an
error, so its return type is changed to void.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Romit Dasgupta <romit@ti.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/power/power.h')
-rw-r--r-- | drivers/base/power/power.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index a3252c0e2887..41f51fae042f 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -1,3 +1,8 @@ +static inline void device_pm_init(struct device *dev) +{ + dev->power.status = DPM_ON; +} + #ifdef CONFIG_PM_SLEEP /* @@ -11,12 +16,12 @@ static inline struct device *to_device(struct list_head *entry) return container_of(entry, struct device, power.entry); } -extern int device_pm_add(struct device *); +extern void device_pm_add(struct device *); extern void device_pm_remove(struct device *); #else /* CONFIG_PM_SLEEP */ -static inline int device_pm_add(struct device *dev) { return 0; } +static inline void device_pm_add(struct device *dev) {} static inline void device_pm_remove(struct device *dev) {} #endif |