diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:35 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:35 -0400 |
commit | 6148d38b37ce9468cdf5a37ca49b4ac5c091e8fa (patch) | |
tree | 8a1dc43ac8bbed2b85d35670d883cd324600a9f1 /drivers/acpi | |
parent | d52fdf13377c25e7a5620c6bec406bbf6a46d443 (diff) | |
parent | 18468843fac331dfbb700901c8012d17373adfec (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
...
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/ac.c | 17 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 15 | ||||
-rw-r--r-- | drivers/acpi/button.c | 9 | ||||
-rw-r--r-- | drivers/acpi/fan.c | 21 | ||||
-rw-r--r-- | drivers/acpi/power.c | 12 | ||||
-rw-r--r-- | drivers/acpi/processor_driver.c | 6 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 4 | ||||
-rw-r--r-- | drivers/acpi/sbs.c | 10 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 22 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 17 |
10 files changed, 70 insertions, 63 deletions
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 | ||
62 | static int acpi_ac_add(struct acpi_device *device); | 62 | static int acpi_ac_add(struct acpi_device *device); |
63 | static int acpi_ac_remove(struct acpi_device *device, int type); | 63 | static int acpi_ac_remove(struct acpi_device *device, int type); |
64 | static int acpi_ac_resume(struct acpi_device *device); | ||
65 | static void acpi_ac_notify(struct acpi_device *device, u32 event); | 64 | static void acpi_ac_notify(struct acpi_device *device, u32 event); |
66 | 65 | ||
67 | static const struct acpi_device_id ac_device_ids[] = { | 66 | static const struct acpi_device_id ac_device_ids[] = { |
@@ -70,6 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = { | |||
70 | }; | 69 | }; |
71 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); | 70 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); |
72 | 71 | ||
72 | static int acpi_ac_resume(struct device *dev); | ||
73 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); | ||
74 | |||
73 | static struct acpi_driver acpi_ac_driver = { | 75 | static 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 | ||
86 | struct acpi_ac { | 88 | struct 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 | ||
312 | static int acpi_ac_resume(struct acpi_device *device) | 314 | static 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 */ |
1047 | static int acpi_battery_resume(struct acpi_device *device) | 1047 | static 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 | ||
1063 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); | ||
1064 | |||
1058 | static struct acpi_driver acpi_battery_driver = { | 1065 | static 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 | ||
1071 | static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) | 1078 | static 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 | ||
77 | static int acpi_button_add(struct acpi_device *device); | 77 | static int acpi_button_add(struct acpi_device *device); |
78 | static int acpi_button_remove(struct acpi_device *device, int type); | 78 | static int acpi_button_remove(struct acpi_device *device, int type); |
79 | static int acpi_button_resume(struct acpi_device *device); | ||
80 | static void acpi_button_notify(struct acpi_device *device, u32 event); | 79 | static void acpi_button_notify(struct acpi_device *device, u32 event); |
81 | 80 | ||
81 | static int acpi_button_resume(struct device *dev); | ||
82 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); | ||
83 | |||
82 | static struct acpi_driver acpi_button_driver = { | 84 | static 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 | ||
94 | struct acpi_button { | 96 | struct acpi_button { |
@@ -308,8 +310,9 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
308 | } | 310 | } |
309 | } | 311 | } |
310 | 312 | ||
311 | static int acpi_button_resume(struct acpi_device *device) | 313 | static 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 | ||
47 | static int acpi_fan_add(struct acpi_device *device); | 47 | static int acpi_fan_add(struct acpi_device *device); |
48 | static int acpi_fan_remove(struct acpi_device *device, int type); | 48 | static int acpi_fan_remove(struct acpi_device *device, int type); |
49 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); | ||
50 | static int acpi_fan_resume(struct acpi_device *device); | ||
51 | 49 | ||
52 | static const struct acpi_device_id fan_device_ids[] = { | 50 | static 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 | }; |
56 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); | 54 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); |
57 | 55 | ||
56 | static int acpi_fan_suspend(struct device *dev); | ||
57 | static int acpi_fan_resume(struct device *dev); | ||
58 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); | ||
59 | |||
58 | static struct acpi_driver acpi_fan_driver = { | 60 | static 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 | ||
186 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state) | 187 | static 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 | ||
196 | static int acpi_fan_resume(struct acpi_device *device) | 197 | static 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 | ||
61 | static int acpi_power_add(struct acpi_device *device); | 61 | static int acpi_power_add(struct acpi_device *device); |
62 | static int acpi_power_remove(struct acpi_device *device, int type); | 62 | static int acpi_power_remove(struct acpi_device *device, int type); |
63 | static int acpi_power_resume(struct acpi_device *device); | ||
64 | 63 | ||
65 | static const struct acpi_device_id power_device_ids[] = { | 64 | static 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 | }; |
69 | MODULE_DEVICE_TABLE(acpi, power_device_ids); | 68 | MODULE_DEVICE_TABLE(acpi, power_device_ids); |
70 | 69 | ||
70 | static int acpi_power_resume(struct device *dev); | ||
71 | static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume); | ||
72 | |||
71 | static struct acpi_driver acpi_power_driver = { | 73 | static 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 | ||
774 | static int acpi_power_resume(struct acpi_device *device) | 776 | static 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 | }; |
94 | MODULE_DEVICE_TABLE(acpi, processor_device_ids); | 94 | MODULE_DEVICE_TABLE(acpi, processor_device_ids); |
95 | 95 | ||
96 | static SIMPLE_DEV_PM_OPS(acpi_processor_pm, | ||
97 | acpi_processor_suspend, acpi_processor_resume); | ||
98 | |||
96 | static struct acpi_driver acpi_processor_driver = { | 99 | static 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 | ||
240 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) | 240 | int 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 | ||
246 | int acpi_processor_resume(struct acpi_device * device) | 246 | int 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 | ||
991 | static int acpi_sbs_resume(struct acpi_device *device) | 991 | static 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 | ||
1001 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); | ||
1002 | |||
1001 | static struct acpi_driver acpi_sbs_driver = { | 1003 | static 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 | ||
1012 | static int __init acpi_sbs_init(void) | 1014 | static 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 | ||
293 | static 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 | |||
303 | static 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 | |||
313 | static int acpi_bus_match(struct device *dev, struct device_driver *drv) | 293 | static 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 | ||
442 | struct bus_type acpi_bus_type = { | 422 | struct 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 | ||
99 | static int acpi_thermal_add(struct acpi_device *device); | 99 | static int acpi_thermal_add(struct acpi_device *device); |
100 | static int acpi_thermal_remove(struct acpi_device *device, int type); | 100 | static int acpi_thermal_remove(struct acpi_device *device, int type); |
101 | static int acpi_thermal_resume(struct acpi_device *device); | ||
102 | static void acpi_thermal_notify(struct acpi_device *device, u32 event); | 101 | static void acpi_thermal_notify(struct acpi_device *device, u32 event); |
103 | 102 | ||
104 | static const struct acpi_device_id thermal_device_ids[] = { | 103 | static const struct acpi_device_id thermal_device_ids[] = { |
@@ -107,6 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = { | |||
107 | }; | 106 | }; |
108 | MODULE_DEVICE_TABLE(acpi, thermal_device_ids); | 107 | MODULE_DEVICE_TABLE(acpi, thermal_device_ids); |
109 | 108 | ||
109 | static int acpi_thermal_resume(struct device *dev); | ||
110 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); | ||
111 | |||
110 | static struct acpi_driver acpi_thermal_driver = { | 112 | static 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 | ||
122 | struct acpi_thermal_state { | 124 | struct 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 | ||
1044 | static int acpi_thermal_resume(struct acpi_device *device) | 1046 | static 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])) |