Skip to content

Commit 623217a

Browse files
committed
PM / wakeup: Drop wakeup_source_drop()
After commit d856f39ac1cc ("PM / wakeup: Rework wakeup source timer cancellation") wakeup_source_drop() is a trivial wrapper around __pm_relax() and it has no users except for wakeup_source_destroy() and wakeup_source_trash() which also has no users, so drop it along with the latter and make wakeup_source_destroy() call __pm_relax() directly. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 1fad17f commit 623217a

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

drivers/base/power/wakeup.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ struct wakeup_source *wakeup_source_create(const char *name)
106106
}
107107
EXPORT_SYMBOL_GPL(wakeup_source_create);
108108

109-
/**
110-
* wakeup_source_drop - Prepare a struct wakeup_source object for destruction.
111-
* @ws: Wakeup source to prepare for destruction.
112-
*
113-
* Callers must ensure that __pm_stay_awake() or __pm_wakeup_event() will never
114-
* be run in parallel with this function for the same wakeup source object.
115-
*/
116-
void wakeup_source_drop(struct wakeup_source *ws)
117-
{
118-
if (!ws)
119-
return;
120-
121-
__pm_relax(ws);
122-
}
123-
EXPORT_SYMBOL_GPL(wakeup_source_drop);
124-
125109
/*
126110
* Record wakeup_source statistics being deleted into a dummy wakeup_source.
127111
*/
@@ -161,7 +145,7 @@ void wakeup_source_destroy(struct wakeup_source *ws)
161145
if (!ws)
162146
return;
163147

164-
wakeup_source_drop(ws);
148+
__pm_relax(ws);
165149
wakeup_source_record(ws);
166150
kfree_const(ws->name);
167151
kfree(ws);

include/linux/pm_wakeup.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static inline void device_set_wakeup_path(struct device *dev)
9696
/* drivers/base/power/wakeup.c */
9797
extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
9898
extern struct wakeup_source *wakeup_source_create(const char *name);
99-
extern void wakeup_source_drop(struct wakeup_source *ws);
10099
extern void wakeup_source_destroy(struct wakeup_source *ws);
101100
extern void wakeup_source_add(struct wakeup_source *ws);
102101
extern void wakeup_source_remove(struct wakeup_source *ws);
@@ -134,8 +133,6 @@ static inline struct wakeup_source *wakeup_source_create(const char *name)
134133
return NULL;
135134
}
136135

137-
static inline void wakeup_source_drop(struct wakeup_source *ws) {}
138-
139136
static inline void wakeup_source_destroy(struct wakeup_source *ws) {}
140137

141138
static inline void wakeup_source_add(struct wakeup_source *ws) {}
@@ -204,12 +201,6 @@ static inline void wakeup_source_init(struct wakeup_source *ws,
204201
wakeup_source_add(ws);
205202
}
206203

207-
static inline void wakeup_source_trash(struct wakeup_source *ws)
208-
{
209-
wakeup_source_remove(ws);
210-
wakeup_source_drop(ws);
211-
}
212-
213204
static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
214205
{
215206
return pm_wakeup_ws_event(ws, msec, false);

0 commit comments

Comments
 (0)