power.h 775 字节
Newer Older
1
#ifdef CONFIG_PM_SLEEP
L
Linus Torvalds 已提交
2 3 4 5 6

/*
 * main.c
 */

7
extern struct list_head dpm_active;	/* The active device list */
L
Linus Torvalds 已提交
8

9
static inline struct device *to_device(struct list_head *entry)
L
Linus Torvalds 已提交
10
{
11
	return container_of(entry, struct device, power.entry);
L
Linus Torvalds 已提交
12 13
}

14
extern int device_pm_add(struct device *);
L
Linus Torvalds 已提交
15 16
extern void device_pm_remove(struct device *);

17 18
#else /* CONFIG_PM_SLEEP */

19 20
static inline int device_pm_add(struct device *dev) { return 0; }
static inline void device_pm_remove(struct device *dev) {}
21

22 23 24 25
#endif

#ifdef CONFIG_PM

L
Linus Torvalds 已提交
26 27 28 29 30 31 32
/*
 * sysfs.c
 */

extern int dpm_sysfs_add(struct device *);
extern void dpm_sysfs_remove(struct device *);

33
#else /* CONFIG_PM */
L
Linus Torvalds 已提交
34

35
static inline int dpm_sysfs_add(struct device *dev)
L
Linus Torvalds 已提交
36 37 38 39
{
	return 0;
}

40 41
static inline void dpm_sysfs_remove(struct device *dev)
{
L
Linus Torvalds 已提交
42 43 44
}

#endif