Skip to content

Commit

Permalink
PM / core: Clean up some function headers in power.h
Browse files Browse the repository at this point in the history
The power.h is a bit messy due to the various existing CONFIG_PM* Kconfig
combinations. However the final section for wakeup_source_sysfs*() can be
moved inside one of the existing sections rather than adding yet another
one, so let's do that to clean up the code a little bit.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed Nov 8, 2019
1 parent da6043f commit ea0d11c
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions drivers/base/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ static inline bool device_pm_initialized(struct device *dev)
return dev->power.in_dpm_list;
}

/* drivers/base/power/wakeup_stats.c */
extern int wakeup_source_sysfs_add(struct device *parent,
struct wakeup_source *ws);
extern void wakeup_source_sysfs_remove(struct wakeup_source *ws);

extern int pm_wakeup_source_sysfs_add(struct device *parent);

#else /* !CONFIG_PM_SLEEP */

static inline void device_pm_sleep_init(struct device *dev) {}
Expand All @@ -141,6 +148,11 @@ static inline bool device_pm_initialized(struct device *dev)
return device_is_registered(dev);
}

static inline int pm_wakeup_source_sysfs_add(struct device *parent)
{
return 0;
}

#endif /* !CONFIG_PM_SLEEP */

static inline void device_pm_init(struct device *dev)
Expand All @@ -149,21 +161,3 @@ static inline void device_pm_init(struct device *dev)
device_pm_sleep_init(dev);
pm_runtime_init(dev);
}

#ifdef CONFIG_PM_SLEEP

/* drivers/base/power/wakeup_stats.c */
extern int wakeup_source_sysfs_add(struct device *parent,
struct wakeup_source *ws);
extern void wakeup_source_sysfs_remove(struct wakeup_source *ws);

extern int pm_wakeup_source_sysfs_add(struct device *parent);

#else /* !CONFIG_PM_SLEEP */

static inline int pm_wakeup_source_sysfs_add(struct device *parent)
{
return 0;
}

#endif /* CONFIG_PM_SLEEP */

0 comments on commit ea0d11c

Please sign in to comment.