Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
at v3.1 75 lines 2.1 kB view raw
1#ifdef CONFIG_PM_RUNTIME 2 3extern void pm_runtime_init(struct device *dev); 4extern void pm_runtime_remove(struct device *dev); 5 6#else /* !CONFIG_PM_RUNTIME */ 7 8static inline void pm_runtime_init(struct device *dev) {} 9static inline void pm_runtime_remove(struct device *dev) {} 10 11#endif /* !CONFIG_PM_RUNTIME */ 12 13#ifdef CONFIG_PM_SLEEP 14 15/* kernel/power/main.c */ 16extern int pm_async_enabled; 17 18/* drivers/base/power/main.c */ 19extern struct list_head dpm_list; /* The active device list */ 20 21static inline struct device *to_device(struct list_head *entry) 22{ 23 return container_of(entry, struct device, power.entry); 24} 25 26extern void device_pm_init(struct device *dev); 27extern void device_pm_add(struct device *); 28extern void device_pm_remove(struct device *); 29extern void device_pm_move_before(struct device *, struct device *); 30extern void device_pm_move_after(struct device *, struct device *); 31extern void device_pm_move_last(struct device *); 32 33#else /* !CONFIG_PM_SLEEP */ 34 35static inline void device_pm_init(struct device *dev) 36{ 37 spin_lock_init(&dev->power.lock); 38 pm_runtime_init(dev); 39} 40 41static inline void device_pm_remove(struct device *dev) 42{ 43 pm_runtime_remove(dev); 44} 45 46static inline void device_pm_add(struct device *dev) {} 47static inline void device_pm_move_before(struct device *deva, 48 struct device *devb) {} 49static inline void device_pm_move_after(struct device *deva, 50 struct device *devb) {} 51static inline void device_pm_move_last(struct device *dev) {} 52 53#endif /* !CONFIG_PM_SLEEP */ 54 55#ifdef CONFIG_PM 56 57/* 58 * sysfs.c 59 */ 60 61extern int dpm_sysfs_add(struct device *dev); 62extern void dpm_sysfs_remove(struct device *dev); 63extern void rpm_sysfs_remove(struct device *dev); 64extern int wakeup_sysfs_add(struct device *dev); 65extern void wakeup_sysfs_remove(struct device *dev); 66 67#else /* CONFIG_PM */ 68 69static inline int dpm_sysfs_add(struct device *dev) { return 0; } 70static inline void dpm_sysfs_remove(struct device *dev) {} 71static inline void rpm_sysfs_remove(struct device *dev) {} 72static inline int wakeup_sysfs_add(struct device *dev) { return 0; } 73static inline void wakeup_sysfs_remove(struct device *dev) {} 74 75#endif