summaryrefslogtreecommitdiff
path: root/drivers/base/power/wakeup.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-02-11 00:00:11 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2012-02-13 16:25:51 +0100
commit7c95149b7f1f61201b12c73c4862a41bf2428961 (patch)
tree33917dbbd8b8cbbf917262e42baf3a528b752149 /drivers/base/power/wakeup.c
parenta556d5b58345ccf51826b9ceac078072f830738b (diff)
PM / Sleep: Initialize wakeup source locks in wakeup_source_add()
Initialize wakeup source locks in wakeup_source_add() instead of wakeup_source_create(), because otherwise the locks of the wakeup sources that haven't been allocated with wakeup_source_create() aren't initialized and handled properly. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base/power/wakeup.c')
-rw-r--r--drivers/base/power/wakeup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index caf995fb774b..6e591a8a49da 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -64,7 +64,6 @@ struct wakeup_source *wakeup_source_create(const char *name)
if (!ws)
return NULL;
- spin_lock_init(&ws->lock);
if (name)
ws->name = kstrdup(name, GFP_KERNEL);
@@ -105,6 +104,7 @@ void wakeup_source_add(struct wakeup_source *ws)
if (WARN_ON(!ws))
return;
+ spin_lock_init(&ws->lock);
setup_timer(&ws->timer, pm_wakeup_timer_fn, (unsigned long)ws);
ws->active = false;