Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifdef CONFIG_PM_SLEEP
2
3/*
4 * main.c
5 */
6
7extern struct list_head dpm_active; /* The active device list */
8
9static inline struct device *to_device(struct list_head *entry)
10{
11 return container_of(entry, struct device, power.entry);
12}
13
14extern void device_pm_add(struct device *);
15extern void device_pm_remove(struct device *);
16extern void device_pm_schedule_removal(struct device *);
17extern int pm_sleep_lock(void);
18extern void pm_sleep_unlock(void);
19
20#else /* CONFIG_PM_SLEEP */
21
22
23static inline void device_pm_add(struct device *dev)
24{
25}
26
27static inline void device_pm_remove(struct device *dev)
28{
29}
30
31static inline int pm_sleep_lock(void)
32{
33 return 0;
34}
35
36static inline void pm_sleep_unlock(void)
37{
38}
39
40#endif
41
42#ifdef CONFIG_PM
43
44/*
45 * sysfs.c
46 */
47
48extern int dpm_sysfs_add(struct device *);
49extern void dpm_sysfs_remove(struct device *);
50
51#else /* CONFIG_PM */
52
53static inline int dpm_sysfs_add(struct device *dev)
54{
55 return 0;
56}
57
58static inline void dpm_sysfs_remove(struct device *dev)
59{
60}
61
62#endif