aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/dock.c16
-rw-r--r--kernel/power/disk.c8
-rw-r--r--kernel/power/main.c2
3 files changed, 14 insertions, 12 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 215f5b30a1f..54ce12ab43d 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -48,7 +48,7 @@ struct dock_station {
48 unsigned long last_dock_time; 48 unsigned long last_dock_time;
49 u32 flags; 49 u32 flags;
50 spinlock_t dd_lock; 50 spinlock_t dd_lock;
51 spinlock_t hp_lock; 51 struct mutex hp_lock;
52 struct list_head dependent_devices; 52 struct list_head dependent_devices;
53 struct list_head hotplug_devices; 53 struct list_head hotplug_devices;
54}; 54};
@@ -118,9 +118,9 @@ static void
118dock_add_hotplug_device(struct dock_station *ds, 118dock_add_hotplug_device(struct dock_station *ds,
119 struct dock_dependent_device *dd) 119 struct dock_dependent_device *dd)
120{ 120{
121 spin_lock(&ds->hp_lock); 121 mutex_lock(&ds->hp_lock);
122 list_add_tail(&dd->hotplug_list, &ds->hotplug_devices); 122 list_add_tail(&dd->hotplug_list, &ds->hotplug_devices);
123 spin_unlock(&ds->hp_lock); 123 mutex_unlock(&ds->hp_lock);
124} 124}
125 125
126/** 126/**
@@ -134,9 +134,9 @@ static void
134dock_del_hotplug_device(struct dock_station *ds, 134dock_del_hotplug_device(struct dock_station *ds,
135 struct dock_dependent_device *dd) 135 struct dock_dependent_device *dd)
136{ 136{
137 spin_lock(&ds->hp_lock); 137 mutex_lock(&ds->hp_lock);
138 list_del(&dd->hotplug_list); 138 list_del(&dd->hotplug_list);
139 spin_unlock(&ds->hp_lock); 139 mutex_unlock(&ds->hp_lock);
140} 140}
141 141
142/** 142/**
@@ -299,7 +299,7 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
299{ 299{
300 struct dock_dependent_device *dd; 300 struct dock_dependent_device *dd;
301 301
302 spin_lock(&ds->hp_lock); 302 mutex_lock(&ds->hp_lock);
303 303
304 /* 304 /*
305 * First call driver specific hotplug functions 305 * First call driver specific hotplug functions
@@ -321,7 +321,7 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
321 else 321 else
322 dock_create_acpi_device(dd->handle); 322 dock_create_acpi_device(dd->handle);
323 } 323 }
324 spin_unlock(&ds->hp_lock); 324 mutex_unlock(&ds->hp_lock);
325} 325}
326 326
327static void dock_event(struct dock_station *ds, u32 event, int num) 327static void dock_event(struct dock_station *ds, u32 event, int num)
@@ -681,7 +681,7 @@ static int dock_add(acpi_handle handle)
681 INIT_LIST_HEAD(&dock_station->dependent_devices); 681 INIT_LIST_HEAD(&dock_station->dependent_devices);
682 INIT_LIST_HEAD(&dock_station->hotplug_devices); 682 INIT_LIST_HEAD(&dock_station->hotplug_devices);
683 spin_lock_init(&dock_station->dd_lock); 683 spin_lock_init(&dock_station->dd_lock);
684 spin_lock_init(&dock_station->hp_lock); 684 mutex_init(&dock_station->hp_lock);
685 ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); 685 ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
686 686
687 /* initialize platform device stuff */ 687 /* initialize platform device stuff */
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 0b00f56c2ad..88fc5d7ac73 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -60,9 +60,11 @@ static void power_down(suspend_disk_method_t mode)
60{ 60{
61 switch(mode) { 61 switch(mode) {
62 case PM_DISK_PLATFORM: 62 case PM_DISK_PLATFORM:
63 kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); 63 if (pm_ops && pm_ops->enter) {
64 pm_ops->enter(PM_SUSPEND_DISK); 64 kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
65 break; 65 pm_ops->enter(PM_SUSPEND_DISK);
66 break;
67 }
66 case PM_DISK_SHUTDOWN: 68 case PM_DISK_SHUTDOWN:
67 kernel_power_off(); 69 kernel_power_off();
68 break; 70 break;
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 500eb87f643..ff3a6182f5f 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -29,7 +29,7 @@
29DEFINE_MUTEX(pm_mutex); 29DEFINE_MUTEX(pm_mutex);
30 30
31struct pm_ops *pm_ops; 31struct pm_ops *pm_ops;
32suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN; 32suspend_disk_method_t pm_disk_mode = PM_DISK_PLATFORM;
33 33
34/** 34/**
35 * pm_set_ops - Set the global power method table. 35 * pm_set_ops - Set the global power method table.