Driver core: Fix device_move() vs. dpm list ordering, v2
[deliverable/linux.git] / drivers / base / power / power.h
CommitLineData
3b98aeaf
AS
1static inline void device_pm_init(struct device *dev)
2{
3 dev->power.status = DPM_ON;
4}
5
296699de 6#ifdef CONFIG_PM_SLEEP
1da177e4
LT
7
8/*
9 * main.c
10 */
11
1eede070 12extern struct list_head dpm_list; /* The active device list */
1da177e4 13
dec13c15 14static inline struct device *to_device(struct list_head *entry)
1da177e4 15{
cd59abfc 16 return container_of(entry, struct device, power.entry);
1da177e4
LT
17}
18
3b98aeaf 19extern void device_pm_add(struct device *);
1da177e4 20extern void device_pm_remove(struct device *);
ffa6a705
CH
21extern void device_pm_move_before(struct device *, struct device *);
22extern void device_pm_move_after(struct device *, struct device *);
23extern void device_pm_move_last(struct device *);
1da177e4 24
dec13c15
DD
25#else /* CONFIG_PM_SLEEP */
26
3b98aeaf 27static inline void device_pm_add(struct device *dev) {}
58aca232 28static inline void device_pm_remove(struct device *dev) {}
ffa6a705
CH
29static inline void device_pm_move_before(struct device *deva,
30 struct device *devb) {}
31static inline void device_pm_move_after(struct device *deva,
32 struct device *devb) {}
33static inline void device_pm_move_last(struct device *dev) {}
775b64d2 34
dec13c15
DD
35#endif
36
37#ifdef CONFIG_PM
38
1da177e4
LT
39/*
40 * sysfs.c
41 */
42
43extern int dpm_sysfs_add(struct device *);
44extern void dpm_sysfs_remove(struct device *);
45
dec13c15 46#else /* CONFIG_PM */
1da177e4 47
dec13c15 48static inline int dpm_sysfs_add(struct device *dev)
1da177e4
LT
49{
50 return 0;
51}
1da177e4 52
dec13c15
DD
53static inline void dpm_sysfs_remove(struct device *dev)
54{
1da177e4
LT
55}
56
1da177e4 57#endif
This page took 0.425216 seconds and 5 git commands to generate.