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