aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-07-18 18:03:35 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-18 18:03:35 -0400
commit6148d38b37ce9468cdf5a37ca49b4ac5c091e8fa (patch)
tree8a1dc43ac8bbed2b85d35670d883cd324600a9f1
parentd52fdf13377c25e7a5620c6bec406bbf6a46d443 (diff)
parent18468843fac331dfbb700901c8012d17373adfec (diff)
Merge branch 'pm-acpi'
* pm-acpi: (24 commits) olpc-xo15-sci: Use struct dev_pm_ops for power management ACPI / PM: Drop PM callbacks from the ACPI bus type ACPI / PM: Drop legacy driver PM callbacks that are not used any more ACPI / PM: Do not execute legacy driver PM callbacks acpi_power_meter: Use struct dev_pm_ops for power management fujitsu-tablet: Use struct dev_pm_ops for power management classmate-laptop: Use struct dev_pm_ops for power management xo15-ebook: Use struct dev_pm_ops for power management toshiba_bluetooth: Use struct dev_pm_ops for power management panasonic-laptop: Use struct dev_pm_ops for power management sony-laptop: Use struct dev_pm_ops for power management hp_accel: Use struct dev_pm_ops for power management toshiba_acpi: Use struct dev_pm_ops for power management ACPI: Use struct dev_pm_ops for power management in the SBS driver ACPI: Use struct dev_pm_ops for power management in the power driver ACPI: Use struct dev_pm_ops for power management in the button driver ACPI: Use struct dev_pm_ops for power management in the battery driver ACPI: Use struct dev_pm_ops for power management in the AC driver ACPI: Use struct dev_pm_ops for power management in processor driver ACPI: Use struct dev_pm_ops for power management in the thermal driver ...
-rw-r--r--arch/x86/platform/olpc/olpc-xo15-sci.c6
-rw-r--r--drivers/acpi/ac.c17
-rw-r--r--drivers/acpi/battery.c15
-rw-r--r--drivers/acpi/button.c9
-rw-r--r--drivers/acpi/fan.c21
-rw-r--r--drivers/acpi/power.c12
-rw-r--r--drivers/acpi/processor_driver.c6
-rw-r--r--drivers/acpi/processor_idle.c4
-rw-r--r--drivers/acpi/sbs.c10
-rw-r--r--drivers/acpi/scan.c22
-rw-r--r--drivers/acpi/thermal.c17
-rw-r--r--drivers/hwmon/acpi_power_meter.c13
-rw-r--r--drivers/platform/x86/classmate-laptop.c13
-rw-r--r--drivers/platform/x86/fujitsu-tablet.c8
-rw-r--r--drivers/platform/x86/hp_accel.c15
-rw-r--r--drivers/platform/x86/panasonic-laptop.c16
-rw-r--r--drivers/platform/x86/sony-laptop.c20
-rw-r--r--drivers/platform/x86/toshiba_acpi.c15
-rw-r--r--drivers/platform/x86/toshiba_bluetooth.c10
-rw-r--r--drivers/platform/x86/xo15-ebook.c8
-rw-r--r--include/acpi/acpi_bus.h5
-rw-r--r--include/acpi/processor.h4
22 files changed, 148 insertions, 118 deletions
diff --git a/arch/x86/platform/olpc/olpc-xo15-sci.c b/arch/x86/platform/olpc/olpc-xo15-sci.c
index 23e5b9d7977b..599be499fdf7 100644
--- a/arch/x86/platform/olpc/olpc-xo15-sci.c
+++ b/arch/x86/platform/olpc/olpc-xo15-sci.c
@@ -203,7 +203,7 @@ static int xo15_sci_remove(struct acpi_device *device, int type)
203 return 0; 203 return 0;
204} 204}
205 205
206static int xo15_sci_resume(struct acpi_device *device) 206static int xo15_sci_resume(struct device *dev)
207{ 207{
208 /* Enable all EC events */ 208 /* Enable all EC events */
209 olpc_ec_mask_write(EC_SCI_SRC_ALL); 209 olpc_ec_mask_write(EC_SCI_SRC_ALL);
@@ -215,6 +215,8 @@ static int xo15_sci_resume(struct acpi_device *device)
215 return 0; 215 return 0;
216} 216}
217 217
218static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume);
219
218static const struct acpi_device_id xo15_sci_device_ids[] = { 220static const struct acpi_device_id xo15_sci_device_ids[] = {
219 {"XO15EC", 0}, 221 {"XO15EC", 0},
220 {"", 0}, 222 {"", 0},
@@ -227,8 +229,8 @@ static struct acpi_driver xo15_sci_drv = {
227 .ops = { 229 .ops = {
228 .add = xo15_sci_add, 230 .add = xo15_sci_add,
229 .remove = xo15_sci_remove, 231 .remove = xo15_sci_remove,
230 .resume = xo15_sci_resume,
231 }, 232 },
233 .drv.pm = &xo15_sci_pm,
232}; 234};
233 235
234static int __init xo15_sci_init(void) 236static int __init xo15_sci_init(void)
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 6512b20aeccd..ff9f6bd48301 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -61,7 +61,6 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file);
61 61
62static int acpi_ac_add(struct acpi_device *device); 62static int acpi_ac_add(struct acpi_device *device);
63static int acpi_ac_remove(struct acpi_device *device, int type); 63static int acpi_ac_remove(struct acpi_device *device, int type);
64static int acpi_ac_resume(struct acpi_device *device);
65static void acpi_ac_notify(struct acpi_device *device, u32 event); 64static void acpi_ac_notify(struct acpi_device *device, u32 event);
66 65
67static const struct acpi_device_id ac_device_ids[] = { 66static const struct acpi_device_id ac_device_ids[] = {
@@ -70,6 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = {
70}; 69};
71MODULE_DEVICE_TABLE(acpi, ac_device_ids); 70MODULE_DEVICE_TABLE(acpi, ac_device_ids);
72 71
72static int acpi_ac_resume(struct device *dev);
73static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
74
73static struct acpi_driver acpi_ac_driver = { 75static struct acpi_driver acpi_ac_driver = {
74 .name = "ac", 76 .name = "ac",
75 .class = ACPI_AC_CLASS, 77 .class = ACPI_AC_CLASS,
@@ -78,9 +80,9 @@ static struct acpi_driver acpi_ac_driver = {
78 .ops = { 80 .ops = {
79 .add = acpi_ac_add, 81 .add = acpi_ac_add,
80 .remove = acpi_ac_remove, 82 .remove = acpi_ac_remove,
81 .resume = acpi_ac_resume,
82 .notify = acpi_ac_notify, 83 .notify = acpi_ac_notify,
83 }, 84 },
85 .drv.pm = &acpi_ac_pm,
84}; 86};
85 87
86struct acpi_ac { 88struct acpi_ac {
@@ -309,13 +311,18 @@ static int acpi_ac_add(struct acpi_device *device)
309 return result; 311 return result;
310} 312}
311 313
312static int acpi_ac_resume(struct acpi_device *device) 314static int acpi_ac_resume(struct device *dev)
313{ 315{
314 struct acpi_ac *ac; 316 struct acpi_ac *ac;
315 unsigned old_state; 317 unsigned old_state;
316 if (!device || !acpi_driver_data(device)) 318
319 if (!dev)
317 return -EINVAL; 320 return -EINVAL;
318 ac = acpi_driver_data(device); 321
322 ac = acpi_driver_data(to_acpi_device(dev));
323 if (!ac)
324 return -EINVAL;
325
319 old_state = ac->state; 326 old_state = ac->state;
320 if (acpi_ac_get_state(ac)) 327 if (acpi_ac_get_state(ac))
321 return 0; 328 return 0;
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 7dd3f9fb9f3f..023f9c8534d0 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1044,17 +1044,24 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
1044} 1044}
1045 1045
1046/* this is needed to learn about changes made in suspended state */ 1046/* this is needed to learn about changes made in suspended state */
1047static int acpi_battery_resume(struct acpi_device *device) 1047static int acpi_battery_resume(struct device *dev)
1048{ 1048{
1049 struct acpi_battery *battery; 1049 struct acpi_battery *battery;
1050 if (!device) 1050
1051 if (!dev)
1051 return -EINVAL; 1052 return -EINVAL;
1052 battery = acpi_driver_data(device); 1053
1054 battery = acpi_driver_data(to_acpi_device(dev));
1055 if (!battery)
1056 return -EINVAL;
1057
1053 battery->update_time = 0; 1058 battery->update_time = 0;
1054 acpi_battery_update(battery); 1059 acpi_battery_update(battery);
1055 return 0; 1060 return 0;
1056} 1061}
1057 1062
1063static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume);
1064
1058static struct acpi_driver acpi_battery_driver = { 1065static struct acpi_driver acpi_battery_driver = {
1059 .name = "battery", 1066 .name = "battery",
1060 .class = ACPI_BATTERY_CLASS, 1067 .class = ACPI_BATTERY_CLASS,
@@ -1062,10 +1069,10 @@ static struct acpi_driver acpi_battery_driver = {
1062 .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, 1069 .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
1063 .ops = { 1070 .ops = {
1064 .add = acpi_battery_add, 1071 .add = acpi_battery_add,
1065 .resume = acpi_battery_resume,
1066 .remove = acpi_battery_remove, 1072 .remove = acpi_battery_remove,
1067 .notify = acpi_battery_notify, 1073 .notify = acpi_battery_notify,
1068 }, 1074 },
1075 .drv.pm = &acpi_battery_pm,
1069}; 1076};
1070 1077
1071static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) 1078static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index d27d072472f9..79d4c22f7a6d 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -76,19 +76,21 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids);
76 76
77static int acpi_button_add(struct acpi_device *device); 77static int acpi_button_add(struct acpi_device *device);
78static int acpi_button_remove(struct acpi_device *device, int type); 78static int acpi_button_remove(struct acpi_device *device, int type);
79static int acpi_button_resume(struct acpi_device *device);
80static void acpi_button_notify(struct acpi_device *device, u32 event); 79static void acpi_button_notify(struct acpi_device *device, u32 event);
81 80
81static int acpi_button_resume(struct device *dev);
82static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);
83
82static struct acpi_driver acpi_button_driver = { 84static struct acpi_driver acpi_button_driver = {
83 .name = "button", 85 .name = "button",
84 .class = ACPI_BUTTON_CLASS, 86 .class = ACPI_BUTTON_CLASS,
85 .ids = button_device_ids, 87 .ids = button_device_ids,
86 .ops = { 88 .ops = {
87 .add = acpi_button_add, 89 .add = acpi_button_add,
88 .resume = acpi_button_resume,
89 .remove = acpi_button_remove, 90 .remove = acpi_button_remove,
90 .notify = acpi_button_notify, 91 .notify = acpi_button_notify,
91 }, 92 },
93 .drv.pm = &acpi_button_pm,
92}; 94};
93 95
94struct acpi_button { 96struct acpi_button {
@@ -308,8 +310,9 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
308 } 310 }
309} 311}
310 312
311static int acpi_button_resume(struct acpi_device *device) 313static int acpi_button_resume(struct device *dev)
312{ 314{
315 struct acpi_device *device = to_acpi_device(dev);
313 struct acpi_button *button = acpi_driver_data(device); 316 struct acpi_button *button = acpi_driver_data(device);
314 317
315 if (button->type == ACPI_BUTTON_TYPE_LID) 318 if (button->type == ACPI_BUTTON_TYPE_LID)
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 0f0356ca1a9e..669d9ee80d16 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -46,8 +46,6 @@ MODULE_LICENSE("GPL");
46 46
47static int acpi_fan_add(struct acpi_device *device); 47static int acpi_fan_add(struct acpi_device *device);
48static int acpi_fan_remove(struct acpi_device *device, int type); 48static int acpi_fan_remove(struct acpi_device *device, int type);
49static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
50static int acpi_fan_resume(struct acpi_device *device);
51 49
52static const struct acpi_device_id fan_device_ids[] = { 50static const struct acpi_device_id fan_device_ids[] = {
53 {"PNP0C0B", 0}, 51 {"PNP0C0B", 0},
@@ -55,6 +53,10 @@ static const struct acpi_device_id fan_device_ids[] = {
55}; 53};
56MODULE_DEVICE_TABLE(acpi, fan_device_ids); 54MODULE_DEVICE_TABLE(acpi, fan_device_ids);
57 55
56static int acpi_fan_suspend(struct device *dev);
57static int acpi_fan_resume(struct device *dev);
58static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);
59
58static struct acpi_driver acpi_fan_driver = { 60static struct acpi_driver acpi_fan_driver = {
59 .name = "fan", 61 .name = "fan",
60 .class = ACPI_FAN_CLASS, 62 .class = ACPI_FAN_CLASS,
@@ -62,9 +64,8 @@ static struct acpi_driver acpi_fan_driver = {
62 .ops = { 64 .ops = {
63 .add = acpi_fan_add, 65 .add = acpi_fan_add,
64 .remove = acpi_fan_remove, 66 .remove = acpi_fan_remove,
65 .suspend = acpi_fan_suspend,
66 .resume = acpi_fan_resume,
67 }, 67 },
68 .drv.pm = &acpi_fan_pm,
68}; 69};
69 70
70/* thermal cooling device callbacks */ 71/* thermal cooling device callbacks */
@@ -183,24 +184,24 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
183 return 0; 184 return 0;
184} 185}
185 186
186static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state) 187static int acpi_fan_suspend(struct device *dev)
187{ 188{
188 if (!device) 189 if (!dev)
189 return -EINVAL; 190 return -EINVAL;
190 191
191 acpi_bus_set_power(device->handle, ACPI_STATE_D0); 192 acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0);
192 193
193 return AE_OK; 194 return AE_OK;
194} 195}
195 196
196static int acpi_fan_resume(struct acpi_device *device) 197static int acpi_fan_resume(struct device *dev)
197{ 198{
198 int result; 199 int result;
199 200
200 if (!device) 201 if (!dev)
201 return -EINVAL; 202 return -EINVAL;
202 203
203 result = acpi_bus_update_power(device->handle, NULL); 204 result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
204 if (result) 205 if (result)
205 printk(KERN_ERR PREFIX "Error updating fan power state\n"); 206 printk(KERN_ERR PREFIX "Error updating fan power state\n");
206 207
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index dd6d6a3c6780..894d45c6bc67 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -60,7 +60,6 @@ ACPI_MODULE_NAME("power");
60 60
61static int acpi_power_add(struct acpi_device *device); 61static int acpi_power_add(struct acpi_device *device);
62static int acpi_power_remove(struct acpi_device *device, int type); 62static int acpi_power_remove(struct acpi_device *device, int type);
63static int acpi_power_resume(struct acpi_device *device);
64 63
65static const struct acpi_device_id power_device_ids[] = { 64static const struct acpi_device_id power_device_ids[] = {
66 {ACPI_POWER_HID, 0}, 65 {ACPI_POWER_HID, 0},
@@ -68,6 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
68}; 67};
69MODULE_DEVICE_TABLE(acpi, power_device_ids); 68MODULE_DEVICE_TABLE(acpi, power_device_ids);
70 69
70static int acpi_power_resume(struct device *dev);
71static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);
72
71static struct acpi_driver acpi_power_driver = { 73static struct acpi_driver acpi_power_driver = {
72 .name = "power", 74 .name = "power",
73 .class = ACPI_POWER_CLASS, 75 .class = ACPI_POWER_CLASS,
@@ -75,8 +77,8 @@ static struct acpi_driver acpi_power_driver = {
75 .ops = { 77 .ops = {
76 .add = acpi_power_add, 78 .add = acpi_power_add,
77 .remove = acpi_power_remove, 79 .remove = acpi_power_remove,
78 .resume = acpi_power_resume,
79 }, 80 },
81 .drv.pm = &acpi_power_pm,
80}; 82};
81 83
82/* 84/*
@@ -771,14 +773,16 @@ static int acpi_power_remove(struct acpi_device *device, int type)
771 return 0; 773 return 0;
772} 774}
773 775
774static int acpi_power_resume(struct acpi_device *device) 776static int acpi_power_resume(struct device *dev)
775{ 777{
776 int result = 0, state; 778 int result = 0, state;
779 struct acpi_device *device;
777 struct acpi_power_resource *resource; 780 struct acpi_power_resource *resource;
778 781
779 if (!device) 782 if (!dev)
780 return -EINVAL; 783 return -EINVAL;
781 784
785 device = to_acpi_device(dev);
782 resource = acpi_driver_data(device); 786 resource = acpi_driver_data(device);
783 if (!resource) 787 if (!resource)
784 return -EINVAL; 788 return -EINVAL;
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 8648b29f6eec..7048b97853e0 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -93,6 +93,9 @@ static const struct acpi_device_id processor_device_ids[] = {
93}; 93};
94MODULE_DEVICE_TABLE(acpi, processor_device_ids); 94MODULE_DEVICE_TABLE(acpi, processor_device_ids);
95 95
96static SIMPLE_DEV_PM_OPS(acpi_processor_pm,
97 acpi_processor_suspend, acpi_processor_resume);
98
96static struct acpi_driver acpi_processor_driver = { 99static struct acpi_driver acpi_processor_driver = {
97 .name = "processor", 100 .name = "processor",
98 .class = ACPI_PROCESSOR_CLASS, 101 .class = ACPI_PROCESSOR_CLASS,
@@ -100,10 +103,9 @@ static struct acpi_driver acpi_processor_driver = {
100 .ops = { 103 .ops = {
101 .add = acpi_processor_add, 104 .add = acpi_processor_add,
102 .remove = acpi_processor_remove, 105 .remove = acpi_processor_remove,
103 .suspend = acpi_processor_suspend,
104 .resume = acpi_processor_resume,
105 .notify = acpi_processor_notify, 106 .notify = acpi_processor_notify,
106 }, 107 },
108 .drv.pm = &acpi_processor_pm,
107}; 109};
108 110
109#define INSTALL_NOTIFY_HANDLER 1 111#define INSTALL_NOTIFY_HANDLER 1
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 4cf964803d7a..e589c1985248 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -237,13 +237,13 @@ static void acpi_idle_bm_rld_restore(void)
237 acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); 237 acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
238} 238}
239 239
240int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) 240int acpi_processor_suspend(struct device *dev)
241{ 241{
242 acpi_idle_bm_rld_save(); 242 acpi_idle_bm_rld_save();
243 return 0; 243 return 0;
244} 244}
245 245
246int acpi_processor_resume(struct acpi_device * device) 246int acpi_processor_resume(struct device *dev)
247{ 247{
248 acpi_idle_bm_rld_restore(); 248 acpi_idle_bm_rld_restore();
249 return 0; 249 return 0;
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 6e36d0c0057c..c0b9aa5faf4c 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void)
988#endif 988#endif
989} 989}
990 990
991static int acpi_sbs_resume(struct acpi_device *device) 991static int acpi_sbs_resume(struct device *dev)
992{ 992{
993 struct acpi_sbs *sbs; 993 struct acpi_sbs *sbs;
994 if (!device) 994 if (!dev)
995 return -EINVAL; 995 return -EINVAL;
996 sbs = device->driver_data; 996 sbs = to_acpi_device(dev)->driver_data;
997 acpi_sbs_callback(sbs); 997 acpi_sbs_callback(sbs);
998 return 0; 998 return 0;
999} 999}
1000 1000
1001static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
1002
1001static struct acpi_driver acpi_sbs_driver = { 1003static struct acpi_driver acpi_sbs_driver = {
1002 .name = "sbs", 1004 .name = "sbs",
1003 .class = ACPI_SBS_CLASS, 1005 .class = ACPI_SBS_CLASS,
@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = {
1005 .ops = { 1007 .ops = {
1006 .add = acpi_sbs_add, 1008 .add = acpi_sbs_add,
1007 .remove = acpi_sbs_remove, 1009 .remove = acpi_sbs_remove,
1008 .resume = acpi_sbs_resume,
1009 }, 1010 },
1011 .drv.pm = &acpi_sbs_pm,
1010}; 1012};
1011 1013
1012static int __init acpi_sbs_init(void) 1014static int __init acpi_sbs_init(void)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index c8a1f3b68110..fdda49336560 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -290,26 +290,6 @@ static void acpi_device_release(struct device *dev)
290 kfree(acpi_dev); 290 kfree(acpi_dev);
291} 291}
292 292
293static int acpi_device_suspend(struct device *dev, pm_message_t state)
294{
295 struct acpi_device *acpi_dev = to_acpi_device(dev);
296 struct acpi_driver *acpi_drv = acpi_dev->driver;
297
298 if (acpi_drv && acpi_drv->ops.suspend)
299 return acpi_drv->ops.suspend(acpi_dev, state);
300 return 0;
301}
302
303static int acpi_device_resume(struct device *dev)
304{
305 struct acpi_device *acpi_dev = to_acpi_device(dev);
306 struct acpi_driver *acpi_drv = acpi_dev->driver;
307
308 if (acpi_drv && acpi_drv->ops.resume)
309 return acpi_drv->ops.resume(acpi_dev);
310 return 0;
311}
312
313static int acpi_bus_match(struct device *dev, struct device_driver *drv) 293static int acpi_bus_match(struct device *dev, struct device_driver *drv)
314{ 294{
315 struct acpi_device *acpi_dev = to_acpi_device(dev); 295 struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -441,8 +421,6 @@ static int acpi_device_remove(struct device * dev)
441 421
442struct bus_type acpi_bus_type = { 422struct bus_type acpi_bus_type = {
443 .name = "acpi", 423 .name = "acpi",
444 .suspend = acpi_device_suspend,
445 .resume = acpi_device_resume,
446 .match = acpi_bus_match, 424 .match = acpi_bus_match,
447 .probe = acpi_device_probe, 425 .probe = acpi_device_probe,
448 .remove = acpi_device_remove, 426 .remove = acpi_device_remove,
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 7dbebea1ec31..21dd4c268aef 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -98,7 +98,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
98 98
99static int acpi_thermal_add(struct acpi_device *device); 99static int acpi_thermal_add(struct acpi_device *device);
100static int acpi_thermal_remove(struct acpi_device *device, int type); 100static int acpi_thermal_remove(struct acpi_device *device, int type);
101static int acpi_thermal_resume(struct acpi_device *device);
102static void acpi_thermal_notify(struct acpi_device *device, u32 event); 101static void acpi_thermal_notify(struct acpi_device *device, u32 event);
103 102
104static const struct acpi_device_id thermal_device_ids[] = { 103static const struct acpi_device_id thermal_device_ids[] = {
@@ -107,6 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
107}; 106};
108MODULE_DEVICE_TABLE(acpi, thermal_device_ids); 107MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
109 108
109static int acpi_thermal_resume(struct device *dev);
110static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);
111
110static struct acpi_driver acpi_thermal_driver = { 112static struct acpi_driver acpi_thermal_driver = {
111 .name = "thermal", 113 .name = "thermal",
112 .class = ACPI_THERMAL_CLASS, 114 .class = ACPI_THERMAL_CLASS,
@@ -114,9 +116,9 @@ static struct acpi_driver acpi_thermal_driver = {
114 .ops = { 116 .ops = {
115 .add = acpi_thermal_add, 117 .add = acpi_thermal_add,
116 .remove = acpi_thermal_remove, 118 .remove = acpi_thermal_remove,
117 .resume = acpi_thermal_resume,
118 .notify = acpi_thermal_notify, 119 .notify = acpi_thermal_notify,
119 }, 120 },
121 .drv.pm = &acpi_thermal_pm,
120}; 122};
121 123
122struct acpi_thermal_state { 124struct acpi_thermal_state {
@@ -1041,16 +1043,17 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1041 return 0; 1043 return 0;
1042} 1044}
1043 1045
1044static int acpi_thermal_resume(struct acpi_device *device) 1046static int acpi_thermal_resume(struct device *dev)
1045{ 1047{
1046 struct acpi_thermal *tz = NULL; 1048 struct acpi_thermal *tz;
1047 int i, j, power_state, result; 1049 int i, j, power_state, result;
1048 1050
1049 1051 if (!dev)
1050 if (!device || !acpi_driver_data(device))
1051 return -EINVAL; 1052 return -EINVAL;
1052 1053
1053 tz = acpi_driver_data(device); 1054 tz = acpi_driver_data(to_acpi_device(dev));
1055 if (!tz)
1056 return -EINVAL;
1054 1057
1055 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { 1058 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
1056 if (!(&tz->trips.active[i])) 1059 if (!(&tz->trips.active[i]))
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 34ad5a27a7e9..e3fcf8146834 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -929,20 +929,25 @@ static int acpi_power_meter_remove(struct acpi_device *device, int type)
929 return 0; 929 return 0;
930} 930}
931 931
932static int acpi_power_meter_resume(struct acpi_device *device) 932static int acpi_power_meter_resume(struct device *dev)
933{ 933{
934 struct acpi_power_meter_resource *resource; 934 struct acpi_power_meter_resource *resource;
935 935
936 if (!device || !acpi_driver_data(device)) 936 if (!dev)
937 return -EINVAL;
938
939 resource = acpi_driver_data(to_acpi_device(dev));
940 if (!resource)
937 return -EINVAL; 941 return -EINVAL;
938 942
939 resource = acpi_driver_data(device);
940 free_capabilities(resource); 943 free_capabilities(resource);
941 read_capabilities(resource); 944 read_capabilities(resource);
942 945
943 return 0; 946 return 0;
944} 947}
945 948
949static SIMPLE_DEV_PM_OPS(acpi_power_meter_pm, NULL, acpi_power_meter_resume);
950
946static struct acpi_driver acpi_power_meter_driver = { 951static struct acpi_driver acpi_power_meter_driver = {
947 .name = "power_meter", 952 .name = "power_meter",
948 .class = ACPI_POWER_METER_CLASS, 953 .class = ACPI_POWER_METER_CLASS,
@@ -950,9 +955,9 @@ static struct acpi_driver acpi_power_meter_driver = {
950 .ops = { 955 .ops = {
951 .add = acpi_power_meter_add, 956 .add = acpi_power_meter_add,
952 .remove = acpi_power_meter_remove, 957 .remove = acpi_power_meter_remove,
953 .resume = acpi_power_meter_resume,
954 .notify = acpi_power_meter_notify, 958 .notify = acpi_power_meter_notify,
955 }, 959 },
960 .drv.pm = &acpi_power_meter_pm,
956}; 961};
957 962
958/* Module init/exit routines */ 963/* Module init/exit routines */
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 94f93b621d7b..e2230a2b2f8e 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -362,15 +362,18 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
362 return cmpc_remove_acpi_notify_device(acpi); 362 return cmpc_remove_acpi_notify_device(acpi);
363} 363}
364 364
365static int cmpc_tablet_resume(struct acpi_device *acpi) 365static int cmpc_tablet_resume(struct device *dev)
366{ 366{
367 struct input_dev *inputdev = dev_get_drvdata(&acpi->dev); 367 struct input_dev *inputdev = dev_get_drvdata(dev);
368
368 unsigned long long val = 0; 369 unsigned long long val = 0;
369 if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) 370 if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
370 input_report_switch(inputdev, SW_TABLET_MODE, !val); 371 input_report_switch(inputdev, SW_TABLET_MODE, !val);
371 return 0; 372 return 0;
372} 373}
373 374
375static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
376
374static const struct acpi_device_id cmpc_tablet_device_ids[] = { 377static const struct acpi_device_id cmpc_tablet_device_ids[] = {
375 {CMPC_TABLET_HID, 0}, 378 {CMPC_TABLET_HID, 0},
376 {"", 0} 379 {"", 0}
@@ -384,9 +387,9 @@ static struct acpi_driver cmpc_tablet_acpi_driver = {
384 .ops = { 387 .ops = {
385 .add = cmpc_tablet_add, 388 .add = cmpc_tablet_add,
386 .remove = cmpc_tablet_remove, 389 .remove = cmpc_tablet_remove,
387 .resume = cmpc_tablet_resume,
388 .notify = cmpc_tablet_handler, 390 .notify = cmpc_tablet_handler,
389 } 391 },
392 .drv.pm = &cmpc_tablet_pm,
390}; 393};
391 394
392 395
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index da267eae8ba8..d2e41735a47b 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -440,12 +440,14 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type)
440 return 0; 440 return 0;
441} 441}
442 442
443static int acpi_fujitsu_resume(struct acpi_device *adev) 443static int acpi_fujitsu_resume(struct device *dev)
444{ 444{
445 fujitsu_reset(); 445 fujitsu_reset();
446 return 0; 446 return 0;
447} 447}
448 448
449static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);
450
449static struct acpi_driver acpi_fujitsu_driver = { 451static struct acpi_driver acpi_fujitsu_driver = {
450 .name = MODULENAME, 452 .name = MODULENAME,
451 .class = "hotkey", 453 .class = "hotkey",
@@ -453,8 +455,8 @@ static struct acpi_driver acpi_fujitsu_driver = {
453 .ops = { 455 .ops = {
454 .add = acpi_fujitsu_add, 456 .add = acpi_fujitsu_add,
455 .remove = acpi_fujitsu_remove, 457 .remove = acpi_fujitsu_remove,
456 .resume = acpi_fujitsu_resume, 458 },
457 } 459 .drv.pm = &acpi_fujitsu_pm,
458}; 460};
459 461
460static int __init fujitsu_module_init(void) 462static int __init fujitsu_module_init(void)
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index 22b2dfa73148..f4d91154ad67 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -353,20 +353,22 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
353 353
354 354
355#ifdef CONFIG_PM 355#ifdef CONFIG_PM
356static int lis3lv02d_suspend(struct acpi_device *device, pm_message_t state) 356static int lis3lv02d_suspend(struct device *dev)
357{ 357{
358 /* make sure the device is off when we suspend */ 358 /* make sure the device is off when we suspend */
359 lis3lv02d_poweroff(&lis3_dev); 359 lis3lv02d_poweroff(&lis3_dev);
360 return 0; 360 return 0;
361} 361}
362 362
363static int lis3lv02d_resume(struct acpi_device *device) 363static int lis3lv02d_resume(struct device *dev)
364{ 364{
365 return lis3lv02d_poweron(&lis3_dev); 365 return lis3lv02d_poweron(&lis3_dev);
366} 366}
367
368static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
369#define HP_ACCEL_PM (&hp_accel_pm)
367#else 370#else
368#define lis3lv02d_suspend NULL 371#define HP_ACCEL_PM NULL
369#define lis3lv02d_resume NULL
370#endif 372#endif
371 373
372/* For the HP MDPS aka 3D Driveguard */ 374/* For the HP MDPS aka 3D Driveguard */
@@ -377,9 +379,8 @@ static struct acpi_driver lis3lv02d_driver = {
377 .ops = { 379 .ops = {
378 .add = lis3lv02d_add, 380 .add = lis3lv02d_add,
379 .remove = lis3lv02d_remove, 381 .remove = lis3lv02d_remove,
380 .suspend = lis3lv02d_suspend, 382 },
381 .resume = lis3lv02d_resume, 383 .drv.pm = HP_ACCEL_PM,
382 }
383}; 384};
384 385
385static int __init lis3lv02d_init_module(void) 386static int __init lis3lv02d_init_module(void)
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index ffff8b4b4949..24480074bcf0 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -177,7 +177,6 @@ enum SINF_BITS { SINF_NUM_BATTERIES = 0,
177 177
178static int acpi_pcc_hotkey_add(struct acpi_device *device); 178static int acpi_pcc_hotkey_add(struct acpi_device *device);
179static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type); 179static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
180static int acpi_pcc_hotkey_resume(struct acpi_device *device);
181static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); 180static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event);
182 181
183static const struct acpi_device_id pcc_device_ids[] = { 182static const struct acpi_device_id pcc_device_ids[] = {
@@ -189,6 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = {
189}; 188};
190MODULE_DEVICE_TABLE(acpi, pcc_device_ids); 189MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
191 190
191static int acpi_pcc_hotkey_resume(struct device *dev);
192static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);
193
192static struct acpi_driver acpi_pcc_driver = { 194static struct acpi_driver acpi_pcc_driver = {
193 .name = ACPI_PCC_DRIVER_NAME, 195 .name = ACPI_PCC_DRIVER_NAME,
194 .class = ACPI_PCC_CLASS, 196 .class = ACPI_PCC_CLASS,
@@ -196,9 +198,9 @@ static struct acpi_driver acpi_pcc_driver = {
196 .ops = { 198 .ops = {
197 .add = acpi_pcc_hotkey_add, 199 .add = acpi_pcc_hotkey_add,
198 .remove = acpi_pcc_hotkey_remove, 200 .remove = acpi_pcc_hotkey_remove,
199 .resume = acpi_pcc_hotkey_resume,
200 .notify = acpi_pcc_hotkey_notify, 201 .notify = acpi_pcc_hotkey_notify,
201 }, 202 },
203 .drv.pm = &acpi_pcc_hotkey_pm,
202}; 204};
203 205
204static const struct key_entry panasonic_keymap[] = { 206static const struct key_entry panasonic_keymap[] = {
@@ -538,11 +540,15 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)
538 540
539/* kernel module interface */ 541/* kernel module interface */
540 542
541static int acpi_pcc_hotkey_resume(struct acpi_device *device) 543static int acpi_pcc_hotkey_resume(struct device *dev)
542{ 544{
543 struct pcc_acpi *pcc = acpi_driver_data(device); 545 struct pcc_acpi *pcc;
546
547 if (!dev)
548 return -EINVAL;
544 549
545 if (device == NULL || pcc == NULL) 550 pcc = acpi_driver_data(to_acpi_device(dev));
551 if (!pcc)
546 return -EINVAL; 552 return -EINVAL;
547 553
548 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", 554 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n",
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 210d4ae547c2..c7a236240785 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1452,7 +1452,7 @@ static void sony_nc_function_resume(void)
1452 &result); 1452 &result);
1453} 1453}
1454 1454
1455static int sony_nc_resume(struct acpi_device *device) 1455static int sony_nc_resume(struct device *dev)
1456{ 1456{
1457 struct sony_nc_value *item; 1457 struct sony_nc_value *item;
1458 acpi_handle handle; 1458 acpi_handle handle;
@@ -1484,6 +1484,8 @@ static int sony_nc_resume(struct acpi_device *device)
1484 return 0; 1484 return 0;
1485} 1485}
1486 1486
1487static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
1488
1487static void sony_nc_rfkill_cleanup(void) 1489static void sony_nc_rfkill_cleanup(void)
1488{ 1490{
1489 int i; 1491 int i;
@@ -2728,9 +2730,9 @@ static struct acpi_driver sony_nc_driver = {
2728 .ops = { 2730 .ops = {
2729 .add = sony_nc_add, 2731 .add = sony_nc_add,
2730 .remove = sony_nc_remove, 2732 .remove = sony_nc_remove,
2731 .resume = sony_nc_resume,
2732 .notify = sony_nc_notify, 2733 .notify = sony_nc_notify,
2733 }, 2734 },
2735 .drv.pm = &sony_nc_pm,
2734}; 2736};
2735 2737
2736/*********** SPIC (SNY6001) Device ***********/ 2738/*********** SPIC (SNY6001) Device ***********/
@@ -4243,19 +4245,22 @@ err_free_resources:
4243 return result; 4245 return result;
4244} 4246}
4245 4247
4246static int sony_pic_suspend(struct acpi_device *device, pm_message_t state) 4248static int sony_pic_suspend(struct device *dev)
4247{ 4249{
4248 if (sony_pic_disable(device)) 4250 if (sony_pic_disable(to_acpi_device(dev)))
4249 return -ENXIO; 4251 return -ENXIO;
4250 return 0; 4252 return 0;
4251} 4253}
4252 4254
4253static int sony_pic_resume(struct acpi_device *device) 4255static int sony_pic_resume(struct device *dev)
4254{ 4256{
4255 sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq); 4257 sony_pic_enable(to_acpi_device(dev),
4258 spic_dev.cur_ioport, spic_dev.cur_irq);
4256 return 0; 4259 return 0;
4257} 4260}
4258 4261
4262static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
4263
4259static const struct acpi_device_id sony_pic_device_ids[] = { 4264static const struct acpi_device_id sony_pic_device_ids[] = {
4260 {SONY_PIC_HID, 0}, 4265 {SONY_PIC_HID, 0},
4261 {"", 0}, 4266 {"", 0},
@@ -4269,9 +4274,8 @@ static struct acpi_driver sony_pic_driver = {
4269 .ops = { 4274 .ops = {
4270 .add = sony_pic_add, 4275 .add = sony_pic_add,
4271 .remove = sony_pic_remove, 4276 .remove = sony_pic_remove,
4272 .suspend = sony_pic_suspend,
4273 .resume = sony_pic_resume,
4274 }, 4277 },
4278 .drv.pm = &sony_pic_pm,
4275}; 4279};
4276 4280
4277static struct dmi_system_id __initdata sonypi_dmi_table[] = { 4281static struct dmi_system_id __initdata sonypi_dmi_table[] = {
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index dab10f6edcd4..c13ba5bac93f 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1296,10 +1296,9 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1296 } 1296 }
1297} 1297}
1298 1298
1299static int toshiba_acpi_suspend(struct acpi_device *acpi_dev, 1299static int toshiba_acpi_suspend(struct device *device)
1300 pm_message_t state)
1301{ 1300{
1302 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1301 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1303 u32 result; 1302 u32 result;
1304 1303
1305 if (dev->hotkey_dev) 1304 if (dev->hotkey_dev)
@@ -1308,9 +1307,9 @@ static int toshiba_acpi_suspend(struct acpi_device *acpi_dev,
1308 return 0; 1307 return 0;
1309} 1308}
1310 1309
1311static int toshiba_acpi_resume(struct acpi_device *acpi_dev) 1310static int toshiba_acpi_resume(struct device *device)
1312{ 1311{
1313 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1312 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1314 u32 result; 1313 u32 result;
1315 1314
1316 if (dev->hotkey_dev) 1315 if (dev->hotkey_dev)
@@ -1319,6 +1318,9 @@ static int toshiba_acpi_resume(struct acpi_device *acpi_dev)
1319 return 0; 1318 return 0;
1320} 1319}
1321 1320
1321static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
1322 toshiba_acpi_suspend, toshiba_acpi_resume);
1323
1322static struct acpi_driver toshiba_acpi_driver = { 1324static struct acpi_driver toshiba_acpi_driver = {
1323 .name = "Toshiba ACPI driver", 1325 .name = "Toshiba ACPI driver",
1324 .owner = THIS_MODULE, 1326 .owner = THIS_MODULE,
@@ -1328,9 +1330,8 @@ static struct acpi_driver toshiba_acpi_driver = {
1328 .add = toshiba_acpi_add, 1330 .add = toshiba_acpi_add,
1329 .remove = toshiba_acpi_remove, 1331 .remove = toshiba_acpi_remove,
1330 .notify = toshiba_acpi_notify, 1332 .notify = toshiba_acpi_notify,
1331 .suspend = toshiba_acpi_suspend,
1332 .resume = toshiba_acpi_resume,
1333 }, 1333 },
1334 .drv.pm = &toshiba_acpi_pm,
1334}; 1335};
1335 1336
1336static int __init toshiba_acpi_init(void) 1337static int __init toshiba_acpi_init(void)
diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c
index 5fb7186694df..715a43cb5e3c 100644
--- a/drivers/platform/x86/toshiba_bluetooth.c
+++ b/drivers/platform/x86/toshiba_bluetooth.c
@@ -34,7 +34,6 @@ MODULE_LICENSE("GPL");
34static int toshiba_bt_rfkill_add(struct acpi_device *device); 34static int toshiba_bt_rfkill_add(struct acpi_device *device);
35static int toshiba_bt_rfkill_remove(struct acpi_device *device, int type); 35static int toshiba_bt_rfkill_remove(struct acpi_device *device, int type);
36static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event); 36static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event);
37static int toshiba_bt_resume(struct acpi_device *device);
38 37
39static const struct acpi_device_id bt_device_ids[] = { 38static const struct acpi_device_id bt_device_ids[] = {
40 { "TOS6205", 0}, 39 { "TOS6205", 0},
@@ -42,6 +41,9 @@ static const struct acpi_device_id bt_device_ids[] = {
42}; 41};
43MODULE_DEVICE_TABLE(acpi, bt_device_ids); 42MODULE_DEVICE_TABLE(acpi, bt_device_ids);
44 43
44static int toshiba_bt_resume(struct device *dev);
45static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume);
46
45static struct acpi_driver toshiba_bt_rfkill_driver = { 47static struct acpi_driver toshiba_bt_rfkill_driver = {
46 .name = "Toshiba BT", 48 .name = "Toshiba BT",
47 .class = "Toshiba", 49 .class = "Toshiba",
@@ -50,9 +52,9 @@ static struct acpi_driver toshiba_bt_rfkill_driver = {
50 .add = toshiba_bt_rfkill_add, 52 .add = toshiba_bt_rfkill_add,
51 .remove = toshiba_bt_rfkill_remove, 53 .remove = toshiba_bt_rfkill_remove,
52 .notify = toshiba_bt_rfkill_notify, 54 .notify = toshiba_bt_rfkill_notify,
53 .resume = toshiba_bt_resume,
54 }, 55 },
55 .owner = THIS_MODULE, 56 .owner = THIS_MODULE,
57 .drv.pm = &toshiba_bt_pm,
56}; 58};
57 59
58 60
@@ -88,9 +90,9 @@ static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event)
88 toshiba_bluetooth_enable(device->handle); 90 toshiba_bluetooth_enable(device->handle);
89} 91}
90 92
91static int toshiba_bt_resume(struct acpi_device *device) 93static int toshiba_bt_resume(struct device *dev)
92{ 94{
93 return toshiba_bluetooth_enable(device->handle); 95 return toshiba_bluetooth_enable(to_acpi_device(dev)->handle);
94} 96}
95 97
96static int toshiba_bt_rfkill_add(struct acpi_device *device) 98static int toshiba_bt_rfkill_add(struct acpi_device *device)
diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c
index fad153dc0355..849c07c13bf6 100644
--- a/drivers/platform/x86/xo15-ebook.c
+++ b/drivers/platform/x86/xo15-ebook.c
@@ -77,11 +77,13 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event)
77 } 77 }
78} 78}
79 79
80static int ebook_switch_resume(struct acpi_device *device) 80static int ebook_switch_resume(struct device *dev)
81{ 81{
82 return ebook_send_state(device); 82 return ebook_send_state(to_acpi_device(dev));
83} 83}
84 84
85static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume);
86
85static int ebook_switch_add(struct acpi_device *device) 87static int ebook_switch_add(struct acpi_device *device)
86{ 88{
87 struct ebook_switch *button; 89 struct ebook_switch *button;
@@ -161,10 +163,10 @@ static struct acpi_driver xo15_ebook_driver = {
161 .ids = ebook_device_ids, 163 .ids = ebook_device_ids,
162 .ops = { 164 .ops = {
163 .add = ebook_switch_add, 165 .add = ebook_switch_add,
164 .resume = ebook_switch_resume,
165 .remove = ebook_switch_remove, 166 .remove = ebook_switch_remove,
166 .notify = ebook_switch_notify, 167 .notify = ebook_switch_notify,
167 }, 168 },
169 .drv.pm = &ebook_switch_pm,
168}; 170};
169 171
170static int __init xo15_ebook_init(void) 172static int __init xo15_ebook_init(void)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 9e6e1c6eb60a..18fd41033e03 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -117,9 +117,6 @@ struct acpi_device;
117typedef int (*acpi_op_add) (struct acpi_device * device); 117typedef int (*acpi_op_add) (struct acpi_device * device);
118typedef int (*acpi_op_remove) (struct acpi_device * device, int type); 118typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
119typedef int (*acpi_op_start) (struct acpi_device * device); 119typedef int (*acpi_op_start) (struct acpi_device * device);
120typedef int (*acpi_op_suspend) (struct acpi_device * device,
121 pm_message_t state);
122typedef int (*acpi_op_resume) (struct acpi_device * device);
123typedef int (*acpi_op_bind) (struct acpi_device * device); 120typedef int (*acpi_op_bind) (struct acpi_device * device);
124typedef int (*acpi_op_unbind) (struct acpi_device * device); 121typedef int (*acpi_op_unbind) (struct acpi_device * device);
125typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); 122typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
@@ -133,8 +130,6 @@ struct acpi_device_ops {
133 acpi_op_add add; 130 acpi_op_add add;
134 acpi_op_remove remove; 131 acpi_op_remove remove;
135 acpi_op_start start; 132 acpi_op_start start;
136 acpi_op_suspend suspend;
137 acpi_op_resume resume;
138 acpi_op_bind bind; 133 acpi_op_bind bind;
139 acpi_op_unbind unbind; 134 acpi_op_unbind unbind;
140 acpi_op_notify notify; 135 acpi_op_notify notify;
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index c72a80160245..64ec644808bc 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -331,8 +331,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr);
331int acpi_processor_hotplug(struct acpi_processor *pr); 331int acpi_processor_hotplug(struct acpi_processor *pr);
332int acpi_processor_power_exit(struct acpi_processor *pr, 332int acpi_processor_power_exit(struct acpi_processor *pr,
333 struct acpi_device *device); 333 struct acpi_device *device);
334int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); 334int acpi_processor_suspend(struct device *dev);
335int acpi_processor_resume(struct acpi_device * device); 335int acpi_processor_resume(struct device *dev);
336extern struct cpuidle_driver acpi_idle_driver; 336extern struct cpuidle_driver acpi_idle_driver;
337 337
338/* in processor_thermal.c */ 338/* in processor_thermal.c */