Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / base / power / power.h
CommitLineData
3b98aeaf
AS
1static inline void device_pm_init(struct device *dev)
2{
3 dev->power.status = DPM_ON;
4}
5
296699de 6#ifdef CONFIG_PM_SLEEP
1da177e4
LT
7
8/*
9 * main.c
10 */
11
1eede070 12extern struct list_head dpm_list; /* The active device list */
1da177e4 13
dec13c15 14static inline struct device *to_device(struct list_head *entry)
1da177e4 15{
cd59abfc 16 return container_of(entry, struct device, power.entry);
1da177e4
LT
17}
18
3b98aeaf 19extern void device_pm_add(struct device *);
1da177e4
LT
20extern void device_pm_remove(struct device *);
21
dec13c15
DD
22#else /* CONFIG_PM_SLEEP */
23
3b98aeaf 24static inline void device_pm_add(struct device *dev) {}
58aca232 25static inline void device_pm_remove(struct device *dev) {}
775b64d2 26
dec13c15
DD
27#endif
28
29#ifdef CONFIG_PM
30
1da177e4
LT
31/*
32 * sysfs.c
33 */
34
35extern int dpm_sysfs_add(struct device *);
36extern void dpm_sysfs_remove(struct device *);
37
dec13c15 38#else /* CONFIG_PM */
1da177e4 39
dec13c15 40static inline int dpm_sysfs_add(struct device *dev)
1da177e4
LT
41{
42 return 0;
43}
1da177e4 44
dec13c15
DD
45static inline void dpm_sysfs_remove(struct device *dev)
46{
1da177e4
LT
47}
48
1da177e4 49#endif