power.h 775 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifdef CONFIG_PM_SLEEP
  2. /*
  3. * main.c
  4. */
  5. extern struct list_head dpm_active; /* The active device list */
  6. static inline struct device *to_device(struct list_head *entry)
  7. {
  8. return container_of(entry, struct device, power.entry);
  9. }
  10. extern int device_pm_add(struct device *);
  11. extern void device_pm_remove(struct device *);
  12. #else /* CONFIG_PM_SLEEP */
  13. static inline int device_pm_add(struct device *dev) { return 0; }
  14. static inline void device_pm_remove(struct device *dev) {}
  15. #endif
  16. #ifdef CONFIG_PM
  17. /*
  18. * sysfs.c
  19. */
  20. extern int dpm_sysfs_add(struct device *);
  21. extern void dpm_sysfs_remove(struct device *);
  22. #else /* CONFIG_PM */
  23. static inline int dpm_sysfs_add(struct device *dev)
  24. {
  25. return 0;
  26. }
  27. static inline void dpm_sysfs_remove(struct device *dev)
  28. {
  29. }
  30. #endif