aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki2012-02-10 17:00:11 -0600
committerArve Hjønnevåg2012-03-16 20:10:25 -0500
commit3c63797031913f63fe31671d6de47014f00af415 (patch)
tree6686fcafaa60fa96c60acc622c1fc063d01b453b
parent10c41e43e1703e11ebbf4707af3174850163024b (diff)
downloadkernel-common-3c63797031913f63fe31671d6de47014f00af415.tar.gz
kernel-common-3c63797031913f63fe31671d6de47014f00af415.tar.xz
kernel-common-3c63797031913f63fe31671d6de47014f00af415.zip
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>
-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 caf995fb774..6e591a8a49d 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)
64 if (!ws) 64 if (!ws)
65 return NULL; 65 return NULL;
66 66
67 spin_lock_init(&ws->lock);
68 if (name) 67 if (name)
69 ws->name = kstrdup(name, GFP_KERNEL); 68 ws->name = kstrdup(name, GFP_KERNEL);
70 69
@@ -105,6 +104,7 @@ void wakeup_source_add(struct wakeup_source *ws)
105 if (WARN_ON(!ws)) 104 if (WARN_ON(!ws))
106 return; 105 return;
107 106
107 spin_lock_init(&ws->lock);
108 setup_timer(&ws->timer, pm_wakeup_timer_fn, (unsigned long)ws); 108 setup_timer(&ws->timer, pm_wakeup_timer_fn, (unsigned long)ws);
109 ws->active = false; 109 ws->active = false;
110 110