Skip to content

Commit ea0d11c

Browse files
storulfrafaeljw
authored andcommitted
PM / core: Clean up some function headers in power.h
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent da6043f commit ea0d11c

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

drivers/base/power/power.h

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ static inline bool device_pm_initialized(struct device *dev)
117117
return dev->power.in_dpm_list;
118118
}
119119

120+
/* drivers/base/power/wakeup_stats.c */
121+
extern int wakeup_source_sysfs_add(struct device *parent,
122+
struct wakeup_source *ws);
123+
extern void wakeup_source_sysfs_remove(struct wakeup_source *ws);
124+
125+
extern int pm_wakeup_source_sysfs_add(struct device *parent);
126+
120127
#else /* !CONFIG_PM_SLEEP */
121128

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

151+
static inline int pm_wakeup_source_sysfs_add(struct device *parent)
152+
{
153+
return 0;
154+
}
155+
144156
#endif /* !CONFIG_PM_SLEEP */
145157

146158
static inline void device_pm_init(struct device *dev)
@@ -149,21 +161,3 @@ static inline void device_pm_init(struct device *dev)
149161
device_pm_sleep_init(dev);
150162
pm_runtime_init(dev);
151163
}
152-
153-
#ifdef CONFIG_PM_SLEEP
154-
155-
/* drivers/base/power/wakeup_stats.c */
156-
extern int wakeup_source_sysfs_add(struct device *parent,
157-
struct wakeup_source *ws);
158-
extern void wakeup_source_sysfs_remove(struct wakeup_source *ws);
159-
160-
extern int pm_wakeup_source_sysfs_add(struct device *parent);
161-
162-
#else /* !CONFIG_PM_SLEEP */
163-
164-
static inline int pm_wakeup_source_sysfs_add(struct device *parent)
165-
{
166-
return 0;
167-
}
168-
169-
#endif /* CONFIG_PM_SLEEP */

0 commit comments

Comments
 (0)