blob: a3252c0e28878fde258ebac8c10ad7c10cafbb86 [file] [log] [blame]
Rafael J. Wysocki296699d2007-07-29 23:27:18 +02001#ifdef CONFIG_PM_SLEEP
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3/*
4 * main.c
5 */
6
Rafael J. Wysocki1eede072008-05-20 23:00:01 +02007extern struct list_head dpm_list; /* The active device list */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Daniel Drakedec13c12007-11-21 14:55:18 -08009static inline struct device *to_device(struct list_head *entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070010{
Alan Sterncd59abf2007-09-21 15:36:56 -040011 return container_of(entry, struct device, power.entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -070012}
13
Rafael J. Wysocki58aca232008-03-12 00:57:22 +010014extern int device_pm_add(struct device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070015extern void device_pm_remove(struct device *);
16
Daniel Drakedec13c12007-11-21 14:55:18 -080017#else /* CONFIG_PM_SLEEP */
18
Rafael J. Wysocki58aca232008-03-12 00:57:22 +010019static inline int device_pm_add(struct device *dev) { return 0; }
20static inline void device_pm_remove(struct device *dev) {}
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010021
Daniel Drakedec13c12007-11-21 14:55:18 -080022#endif
23
24#ifdef CONFIG_PM
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026/*
27 * sysfs.c
28 */
29
30extern int dpm_sysfs_add(struct device *);
31extern void dpm_sysfs_remove(struct device *);
32
Daniel Drakedec13c12007-11-21 14:55:18 -080033#else /* CONFIG_PM */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Daniel Drakedec13c12007-11-21 14:55:18 -080035static inline int dpm_sysfs_add(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070036{
37 return 0;
38}
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Daniel Drakedec13c12007-11-21 14:55:18 -080040static inline void dpm_sysfs_remove(struct device *dev)
41{
Linus Torvalds1da177e2005-04-16 15:20:36 -070042}
43
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#endif