aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/ac.c4
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/acpi/button.c4
-rw-r--r--drivers/acpi/fan.c4
-rw-r--r--drivers/acpi/power.c4
-rw-r--r--drivers/acpi/sbs.c2
-rw-r--r--drivers/acpi/thermal.c4
-rw-r--r--drivers/base/power/clock_ops.c3
-rw-r--r--drivers/base/power/common.c4
-rw-r--r--drivers/char/tpm/tpm_tis.c2
-rw-r--r--drivers/cpufreq/pcc-cpufreq.c1
-rw-r--r--drivers/platform/x86/classmate-laptop.c4
-rw-r--r--drivers/platform/x86/fujitsu-tablet.c2
-rw-r--r--drivers/platform/x86/hdaps.c2
-rw-r--r--drivers/platform/x86/hp_accel.c2
-rw-r--r--drivers/platform/x86/msi-laptop.c4
-rw-r--r--drivers/platform/x86/panasonic-laptop.c4
-rw-r--r--drivers/platform/x86/sony-laptop.c12
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c2
-rw-r--r--drivers/platform/x86/toshiba_acpi.c2
-rw-r--r--drivers/platform/x86/toshiba_bluetooth.c4
-rw-r--r--drivers/platform/x86/xo15-ebook.c2
-rw-r--r--drivers/rtc/interface.c2
-rw-r--r--drivers/rtc/rtc-cmos.c1
-rw-r--r--include/linux/sched.h8
-rw-r--r--kernel/power/suspend.c3
-rw-r--r--kernel/watchdog.c21
27 files changed, 71 insertions, 38 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index ac7034129f3..d5fdd36190c 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -69,7 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = {
69}; 69};
70MODULE_DEVICE_TABLE(acpi, ac_device_ids); 70MODULE_DEVICE_TABLE(acpi, ac_device_ids);
71 71
72#ifdef CONFIG_PM_SLEEP
72static int acpi_ac_resume(struct device *dev); 73static int acpi_ac_resume(struct device *dev);
74#endif
73static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); 75static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
74 76
75static struct acpi_driver acpi_ac_driver = { 77static struct acpi_driver acpi_ac_driver = {
@@ -313,6 +315,7 @@ static int acpi_ac_add(struct acpi_device *device)
313 return result; 315 return result;
314} 316}
315 317
318#ifdef CONFIG_PM_SLEEP
316static int acpi_ac_resume(struct device *dev) 319static int acpi_ac_resume(struct device *dev)
317{ 320{
318 struct acpi_ac *ac; 321 struct acpi_ac *ac;
@@ -332,6 +335,7 @@ static int acpi_ac_resume(struct device *dev)
332 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 335 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
333 return 0; 336 return 0;
334} 337}
338#endif
335 339
336static int acpi_ac_remove(struct acpi_device *device, int type) 340static int acpi_ac_remove(struct acpi_device *device, int type)
337{ 341{
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index ff2c876ec41..45e3e1759fb 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1052,6 +1052,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
1052 return 0; 1052 return 0;
1053} 1053}
1054 1054
1055#ifdef CONFIG_PM_SLEEP
1055/* this is needed to learn about changes made in suspended state */ 1056/* this is needed to learn about changes made in suspended state */
1056static int acpi_battery_resume(struct device *dev) 1057static int acpi_battery_resume(struct device *dev)
1057{ 1058{
@@ -1068,6 +1069,7 @@ static int acpi_battery_resume(struct device *dev)
1068 acpi_battery_update(battery); 1069 acpi_battery_update(battery);
1069 return 0; 1070 return 0;
1070} 1071}
1072#endif
1071 1073
1072static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); 1074static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume);
1073 1075
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 79d4c22f7a6..314a3b84bbc 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -78,7 +78,9 @@ static 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 void acpi_button_notify(struct acpi_device *device, u32 event); 79static void acpi_button_notify(struct acpi_device *device, u32 event);
80 80
81#ifdef CONFIG_PM_SLEEP
81static int acpi_button_resume(struct device *dev); 82static int acpi_button_resume(struct device *dev);
83#endif
82static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); 84static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);
83 85
84static struct acpi_driver acpi_button_driver = { 86static struct acpi_driver acpi_button_driver = {
@@ -310,6 +312,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
310 } 312 }
311} 313}
312 314
315#ifdef CONFIG_PM_SLEEP
313static int acpi_button_resume(struct device *dev) 316static int acpi_button_resume(struct device *dev)
314{ 317{
315 struct acpi_device *device = to_acpi_device(dev); 318 struct acpi_device *device = to_acpi_device(dev);
@@ -319,6 +322,7 @@ static int acpi_button_resume(struct device *dev)
319 return acpi_lid_send_state(device); 322 return acpi_lid_send_state(device);
320 return 0; 323 return 0;
321} 324}
325#endif
322 326
323static int acpi_button_add(struct acpi_device *device) 327static int acpi_button_add(struct acpi_device *device)
324{ 328{
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 669d9ee80d1..bc36a476f1a 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -53,8 +53,10 @@ static const struct acpi_device_id fan_device_ids[] = {
53}; 53};
54MODULE_DEVICE_TABLE(acpi, fan_device_ids); 54MODULE_DEVICE_TABLE(acpi, fan_device_ids);
55 55
56#ifdef CONFIG_PM_SLEEP
56static int acpi_fan_suspend(struct device *dev); 57static int acpi_fan_suspend(struct device *dev);
57static int acpi_fan_resume(struct device *dev); 58static int acpi_fan_resume(struct device *dev);
59#endif
58static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); 60static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);
59 61
60static struct acpi_driver acpi_fan_driver = { 62static struct acpi_driver acpi_fan_driver = {
@@ -184,6 +186,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
184 return 0; 186 return 0;
185} 187}
186 188
189#ifdef CONFIG_PM_SLEEP
187static int acpi_fan_suspend(struct device *dev) 190static int acpi_fan_suspend(struct device *dev)
188{ 191{
189 if (!dev) 192 if (!dev)
@@ -207,6 +210,7 @@ static int acpi_fan_resume(struct device *dev)
207 210
208 return result; 211 return result;
209} 212}
213#endif
210 214
211static int __init acpi_fan_init(void) 215static int __init acpi_fan_init(void)
212{ 216{
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 215ecd09740..fc180341462 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -67,7 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
67}; 67};
68MODULE_DEVICE_TABLE(acpi, power_device_ids); 68MODULE_DEVICE_TABLE(acpi, power_device_ids);
69 69
70#ifdef CONFIG_PM_SLEEP
70static int acpi_power_resume(struct device *dev); 71static int acpi_power_resume(struct device *dev);
72#endif
71static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume); 73static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);
72 74
73static struct acpi_driver acpi_power_driver = { 75static struct acpi_driver acpi_power_driver = {
@@ -775,6 +777,7 @@ static int acpi_power_remove(struct acpi_device *device, int type)
775 return 0; 777 return 0;
776} 778}
777 779
780#ifdef CONFIG_PM_SLEEP
778static int acpi_power_resume(struct device *dev) 781static int acpi_power_resume(struct device *dev)
779{ 782{
780 int result = 0, state; 783 int result = 0, state;
@@ -803,6 +806,7 @@ static int acpi_power_resume(struct device *dev)
803 806
804 return result; 807 return result;
805} 808}
809#endif
806 810
807int __init acpi_power_init(void) 811int __init acpi_power_init(void)
808{ 812{
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index c0b9aa5faf4..ff0740e0a9c 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -988,6 +988,7 @@ static void acpi_sbs_rmdirs(void)
988#endif 988#endif
989} 989}
990 990
991#ifdef CONFIG_PM_SLEEP
991static int acpi_sbs_resume(struct device *dev) 992static int acpi_sbs_resume(struct device *dev)
992{ 993{
993 struct acpi_sbs *sbs; 994 struct acpi_sbs *sbs;
@@ -997,6 +998,7 @@ static int acpi_sbs_resume(struct device *dev)
997 acpi_sbs_callback(sbs); 998 acpi_sbs_callback(sbs);
998 return 0; 999 return 0;
999} 1000}
1001#endif
1000 1002
1001static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); 1003static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
1002 1004
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9fe90e9fecb..edda74a4340 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -106,7 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
106}; 106};
107MODULE_DEVICE_TABLE(acpi, thermal_device_ids); 107MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
108 108
109#ifdef CONFIG_PM_SLEEP
109static int acpi_thermal_resume(struct device *dev); 110static int acpi_thermal_resume(struct device *dev);
111#endif
110static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); 112static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);
111 113
112static struct acpi_driver acpi_thermal_driver = { 114static struct acpi_driver acpi_thermal_driver = {
@@ -1041,6 +1043,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1041 return 0; 1043 return 0;
1042} 1044}
1043 1045
1046#ifdef CONFIG_PM_SLEEP
1044static int acpi_thermal_resume(struct device *dev) 1047static int acpi_thermal_resume(struct device *dev)
1045{ 1048{
1046 struct acpi_thermal *tz; 1049 struct acpi_thermal *tz;
@@ -1075,6 +1078,7 @@ static int acpi_thermal_resume(struct device *dev)
1075 1078
1076 return AE_OK; 1079 return AE_OK;
1077} 1080}
1081#endif
1078 1082
1079static int thermal_act(const struct dmi_system_id *d) { 1083static int thermal_act(const struct dmi_system_id *d) {
1080 1084
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 869d7ff2227..eb78e9640c4 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -169,8 +169,7 @@ void pm_clk_init(struct device *dev)
169 */ 169 */
170int pm_clk_create(struct device *dev) 170int pm_clk_create(struct device *dev)
171{ 171{
172 int ret = dev_pm_get_subsys_data(dev); 172 return dev_pm_get_subsys_data(dev);
173 return ret < 0 ? ret : 0;
174} 173}
175 174
176/** 175/**
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index a14085cc613..39c32529b83 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -24,7 +24,6 @@
24int dev_pm_get_subsys_data(struct device *dev) 24int dev_pm_get_subsys_data(struct device *dev)
25{ 25{
26 struct pm_subsys_data *psd; 26 struct pm_subsys_data *psd;
27 int ret = 0;
28 27
29 psd = kzalloc(sizeof(*psd), GFP_KERNEL); 28 psd = kzalloc(sizeof(*psd), GFP_KERNEL);
30 if (!psd) 29 if (!psd)
@@ -40,7 +39,6 @@ int dev_pm_get_subsys_data(struct device *dev)
40 dev->power.subsys_data = psd; 39 dev->power.subsys_data = psd;
41 pm_clk_init(dev); 40 pm_clk_init(dev);
42 psd = NULL; 41 psd = NULL;
43 ret = 1;
44 } 42 }
45 43
46 spin_unlock_irq(&dev->power.lock); 44 spin_unlock_irq(&dev->power.lock);
@@ -48,7 +46,7 @@ int dev_pm_get_subsys_data(struct device *dev)
48 /* kfree() verifies that its argument is nonzero. */ 46 /* kfree() verifies that its argument is nonzero. */
49 kfree(psd); 47 kfree(psd);
50 48
51 return ret; 49 return 0;
52} 50}
53EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data); 51EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
54 52
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 89682fa8801..c4be3519a58 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -807,6 +807,7 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
807MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); 807MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
808#endif 808#endif
809 809
810#ifdef CONFIG_PM_SLEEP
810static int tpm_tis_resume(struct device *dev) 811static int tpm_tis_resume(struct device *dev)
811{ 812{
812 struct tpm_chip *chip = dev_get_drvdata(dev); 813 struct tpm_chip *chip = dev_get_drvdata(dev);
@@ -816,6 +817,7 @@ static int tpm_tis_resume(struct device *dev)
816 817
817 return tpm_pm_resume(dev); 818 return tpm_pm_resume(dev);
818} 819}
820#endif
819 821
820static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_resume); 822static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_resume);
821 823
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
index cdc02ac8f41..503996a94a6 100644
--- a/drivers/cpufreq/pcc-cpufreq.c
+++ b/drivers/cpufreq/pcc-cpufreq.c
@@ -454,6 +454,7 @@ static int __init pcc_cpufreq_probe(void)
454 mem_resource->address_length); 454 mem_resource->address_length);
455 if (pcch_virt_addr == NULL) { 455 if (pcch_virt_addr == NULL) {
456 pr_debug("probe: could not map shared mem region\n"); 456 pr_debug("probe: could not map shared mem region\n");
457 ret = -ENOMEM;
457 goto out_free; 458 goto out_free;
458 } 459 }
459 pcch_hdr = pcch_virt_addr; 460 pcch_hdr = pcch_virt_addr;
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 2ca7dd1ab3e..cd33add118c 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -350,6 +350,7 @@ static void cmpc_accel_idev_init_v4(struct input_dev *inputdev)
350 inputdev->close = cmpc_accel_close_v4; 350 inputdev->close = cmpc_accel_close_v4;
351} 351}
352 352
353#ifdef CONFIG_PM_SLEEP
353static int cmpc_accel_suspend_v4(struct device *dev) 354static int cmpc_accel_suspend_v4(struct device *dev)
354{ 355{
355 struct input_dev *inputdev; 356 struct input_dev *inputdev;
@@ -384,6 +385,7 @@ static int cmpc_accel_resume_v4(struct device *dev)
384 385
385 return 0; 386 return 0;
386} 387}
388#endif
387 389
388static int cmpc_accel_add_v4(struct acpi_device *acpi) 390static int cmpc_accel_add_v4(struct acpi_device *acpi)
389{ 391{
@@ -752,6 +754,7 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
752 return cmpc_remove_acpi_notify_device(acpi); 754 return cmpc_remove_acpi_notify_device(acpi);
753} 755}
754 756
757#ifdef CONFIG_PM_SLEEP
755static int cmpc_tablet_resume(struct device *dev) 758static int cmpc_tablet_resume(struct device *dev)
756{ 759{
757 struct input_dev *inputdev = dev_get_drvdata(dev); 760 struct input_dev *inputdev = dev_get_drvdata(dev);
@@ -761,6 +764,7 @@ static int cmpc_tablet_resume(struct device *dev)
761 input_report_switch(inputdev, SW_TABLET_MODE, !val); 764 input_report_switch(inputdev, SW_TABLET_MODE, !val);
762 return 0; 765 return 0;
763} 766}
767#endif
764 768
765static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume); 769static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
766 770
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index d2e41735a47..7acae3f85f3 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -440,11 +440,13 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type)
440 return 0; 440 return 0;
441} 441}
442 442
443#ifdef CONFIG_PM_SLEEP
443static int acpi_fujitsu_resume(struct device *dev) 444static int acpi_fujitsu_resume(struct device *dev)
444{ 445{
445 fujitsu_reset(); 446 fujitsu_reset();
446 return 0; 447 return 0;
447} 448}
449#endif
448 450
449static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume); 451static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);
450 452
diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
index d9ab6f64dce..777c7e3dda5 100644
--- a/drivers/platform/x86/hdaps.c
+++ b/drivers/platform/x86/hdaps.c
@@ -305,10 +305,12 @@ static int hdaps_probe(struct platform_device *dev)
305 return 0; 305 return 0;
306} 306}
307 307
308#ifdef CONFIG_PM_SLEEP
308static int hdaps_resume(struct device *dev) 309static int hdaps_resume(struct device *dev)
309{ 310{
310 return hdaps_device_init(); 311 return hdaps_device_init();
311} 312}
313#endif
312 314
313static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume); 315static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);
314 316
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index f4d91154ad6..6b9af989632 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -352,7 +352,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
352} 352}
353 353
354 354
355#ifdef CONFIG_PM 355#ifdef CONFIG_PM_SLEEP
356static int lis3lv02d_suspend(struct device *dev) 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 */
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index f6444184431..2111dbb7e1e 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -85,7 +85,9 @@
85#define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4 85#define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4
86#define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4) 86#define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4)
87 87
88#ifdef CONFIG_PM_SLEEP
88static int msi_laptop_resume(struct device *device); 89static int msi_laptop_resume(struct device *device);
90#endif
89static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume); 91static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);
90 92
91#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f 93#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f
@@ -753,6 +755,7 @@ err_bluetooth:
753 return retval; 755 return retval;
754} 756}
755 757
758#ifdef CONFIG_PM_SLEEP
756static int msi_laptop_resume(struct device *device) 759static int msi_laptop_resume(struct device *device)
757{ 760{
758 u8 data; 761 u8 data;
@@ -773,6 +776,7 @@ static int msi_laptop_resume(struct device *device)
773 776
774 return 0; 777 return 0;
775} 778}
779#endif
776 780
777static int __init msi_laptop_input_setup(void) 781static int __init msi_laptop_input_setup(void)
778{ 782{
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 24480074bcf..8e8caa767d6 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -188,7 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = {
188}; 188};
189MODULE_DEVICE_TABLE(acpi, pcc_device_ids); 189MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
190 190
191#ifdef CONFIG_PM_SLEEP
191static int acpi_pcc_hotkey_resume(struct device *dev); 192static int acpi_pcc_hotkey_resume(struct device *dev);
193#endif
192static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume); 194static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);
193 195
194static struct acpi_driver acpi_pcc_driver = { 196static struct acpi_driver acpi_pcc_driver = {
@@ -540,6 +542,7 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)
540 542
541/* kernel module interface */ 543/* kernel module interface */
542 544
545#ifdef CONFIG_PM_SLEEP
543static int acpi_pcc_hotkey_resume(struct device *dev) 546static int acpi_pcc_hotkey_resume(struct device *dev)
544{ 547{
545 struct pcc_acpi *pcc; 548 struct pcc_acpi *pcc;
@@ -556,6 +559,7 @@ static int acpi_pcc_hotkey_resume(struct device *dev)
556 559
557 return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode); 560 return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);
558} 561}
562#endif
559 563
560static int acpi_pcc_hotkey_add(struct acpi_device *device) 564static int acpi_pcc_hotkey_add(struct acpi_device *device)
561{ 565{
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 9363969ad07..daaddec68de 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -140,7 +140,10 @@ MODULE_PARM_DESC(kbd_backlight_timeout,
140 "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " 140 "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout "
141 "(default: 0)"); 141 "(default: 0)");
142 142
143#ifdef CONFIG_PM_SLEEP
143static void sony_nc_kbd_backlight_resume(void); 144static void sony_nc_kbd_backlight_resume(void);
145static void sony_nc_thermal_resume(void);
146#endif
144static int sony_nc_kbd_backlight_setup(struct platform_device *pd, 147static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
145 unsigned int handle); 148 unsigned int handle);
146static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd); 149static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd);
@@ -151,7 +154,6 @@ static void sony_nc_battery_care_cleanup(struct platform_device *pd);
151 154
152static int sony_nc_thermal_setup(struct platform_device *pd); 155static int sony_nc_thermal_setup(struct platform_device *pd);
153static void sony_nc_thermal_cleanup(struct platform_device *pd); 156static void sony_nc_thermal_cleanup(struct platform_device *pd);
154static void sony_nc_thermal_resume(void);
155 157
156static int sony_nc_lid_resume_setup(struct platform_device *pd); 158static int sony_nc_lid_resume_setup(struct platform_device *pd);
157static void sony_nc_lid_resume_cleanup(struct platform_device *pd); 159static void sony_nc_lid_resume_cleanup(struct platform_device *pd);
@@ -1431,6 +1433,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
1431 sony_nc_handles_cleanup(pd); 1433 sony_nc_handles_cleanup(pd);
1432} 1434}
1433 1435
1436#ifdef CONFIG_PM_SLEEP
1434static void sony_nc_function_resume(void) 1437static void sony_nc_function_resume(void)
1435{ 1438{
1436 unsigned int i, result, bitmask, arg; 1439 unsigned int i, result, bitmask, arg;
@@ -1508,6 +1511,7 @@ static int sony_nc_resume(struct device *dev)
1508 1511
1509 return 0; 1512 return 0;
1510} 1513}
1514#endif
1511 1515
1512static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); 1516static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
1513 1517
@@ -1872,6 +1876,7 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd)
1872 } 1876 }
1873} 1877}
1874 1878
1879#ifdef CONFIG_PM_SLEEP
1875static void sony_nc_kbd_backlight_resume(void) 1880static void sony_nc_kbd_backlight_resume(void)
1876{ 1881{
1877 int ignore = 0; 1882 int ignore = 0;
@@ -1888,6 +1893,7 @@ static void sony_nc_kbd_backlight_resume(void)
1888 (kbdbl_ctl->base + 0x200) | 1893 (kbdbl_ctl->base + 0x200) |
1889 (kbdbl_ctl->timeout << 0x10), &ignore); 1894 (kbdbl_ctl->timeout << 0x10), &ignore);
1890} 1895}
1896#endif
1891 1897
1892struct battery_care_control { 1898struct battery_care_control {
1893 struct device_attribute attrs[2]; 1899 struct device_attribute attrs[2];
@@ -2210,6 +2216,7 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
2210 } 2216 }
2211} 2217}
2212 2218
2219#ifdef CONFIG_PM_SLEEP
2213static void sony_nc_thermal_resume(void) 2220static void sony_nc_thermal_resume(void)
2214{ 2221{
2215 unsigned int status = sony_nc_thermal_mode_get(); 2222 unsigned int status = sony_nc_thermal_mode_get();
@@ -2217,6 +2224,7 @@ static void sony_nc_thermal_resume(void)
2217 if (status != th_handle->mode) 2224 if (status != th_handle->mode)
2218 sony_nc_thermal_mode_set(th_handle->mode); 2225 sony_nc_thermal_mode_set(th_handle->mode);
2219} 2226}
2227#endif
2220 2228
2221/* resume on LID open */ 2229/* resume on LID open */
2222struct snc_lid_resume_control { 2230struct snc_lid_resume_control {
@@ -4287,6 +4295,7 @@ err_free_resources:
4287 return result; 4295 return result;
4288} 4296}
4289 4297
4298#ifdef CONFIG_PM_SLEEP
4290static int sony_pic_suspend(struct device *dev) 4299static int sony_pic_suspend(struct device *dev)
4291{ 4300{
4292 if (sony_pic_disable(to_acpi_device(dev))) 4301 if (sony_pic_disable(to_acpi_device(dev)))
@@ -4300,6 +4309,7 @@ static int sony_pic_resume(struct device *dev)
4300 spic_dev.cur_ioport, spic_dev.cur_irq); 4309 spic_dev.cur_ioport, spic_dev.cur_irq);
4301 return 0; 4310 return 0;
4302} 4311}
4312#endif
4303 4313
4304static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); 4314static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
4305 4315
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7f73287636..f28f36ccdcf 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -922,6 +922,7 @@ static struct input_dev *tpacpi_inputdev;
922static struct mutex tpacpi_inputdev_send_mutex; 922static struct mutex tpacpi_inputdev_send_mutex;
923static LIST_HEAD(tpacpi_all_drivers); 923static LIST_HEAD(tpacpi_all_drivers);
924 924
925#ifdef CONFIG_PM_SLEEP
925static int tpacpi_suspend_handler(struct device *dev) 926static int tpacpi_suspend_handler(struct device *dev)
926{ 927{
927 struct ibm_struct *ibm, *itmp; 928 struct ibm_struct *ibm, *itmp;
@@ -949,6 +950,7 @@ static int tpacpi_resume_handler(struct device *dev)
949 950
950 return 0; 951 return 0;
951} 952}
953#endif
952 954
953static SIMPLE_DEV_PM_OPS(tpacpi_pm, 955static SIMPLE_DEV_PM_OPS(tpacpi_pm,
954 tpacpi_suspend_handler, tpacpi_resume_handler); 956 tpacpi_suspend_handler, tpacpi_resume_handler);
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index c13ba5bac93..5f1256d5e93 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1296,6 +1296,7 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1296 } 1296 }
1297} 1297}
1298 1298
1299#ifdef CONFIG_PM_SLEEP
1299static int toshiba_acpi_suspend(struct device *device) 1300static int toshiba_acpi_suspend(struct device *device)
1300{ 1301{
1301 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device)); 1302 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
@@ -1317,6 +1318,7 @@ static int toshiba_acpi_resume(struct device *device)
1317 1318
1318 return 0; 1319 return 0;
1319} 1320}
1321#endif
1320 1322
1321static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm, 1323static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
1322 toshiba_acpi_suspend, toshiba_acpi_resume); 1324 toshiba_acpi_suspend, toshiba_acpi_resume);
diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c
index 715a43cb5e3..5e5d6317d69 100644
--- a/drivers/platform/x86/toshiba_bluetooth.c
+++ b/drivers/platform/x86/toshiba_bluetooth.c
@@ -41,7 +41,9 @@ static const struct acpi_device_id bt_device_ids[] = {
41}; 41};
42MODULE_DEVICE_TABLE(acpi, bt_device_ids); 42MODULE_DEVICE_TABLE(acpi, bt_device_ids);
43 43
44#ifdef CONFIG_PM_SLEEP
44static int toshiba_bt_resume(struct device *dev); 45static int toshiba_bt_resume(struct device *dev);
46#endif
45static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume); 47static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume);
46 48
47static struct acpi_driver toshiba_bt_rfkill_driver = { 49static struct acpi_driver toshiba_bt_rfkill_driver = {
@@ -90,10 +92,12 @@ static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event)
90 toshiba_bluetooth_enable(device->handle); 92 toshiba_bluetooth_enable(device->handle);
91} 93}
92 94
95#ifdef CONFIG_PM_SLEEP
93static int toshiba_bt_resume(struct device *dev) 96static int toshiba_bt_resume(struct device *dev)
94{ 97{
95 return toshiba_bluetooth_enable(to_acpi_device(dev)->handle); 98 return toshiba_bluetooth_enable(to_acpi_device(dev)->handle);
96} 99}
100#endif
97 101
98static int toshiba_bt_rfkill_add(struct acpi_device *device) 102static int toshiba_bt_rfkill_add(struct acpi_device *device)
99{ 103{
diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c
index 849c07c13bf..38ba39d7ca7 100644
--- a/drivers/platform/x86/xo15-ebook.c
+++ b/drivers/platform/x86/xo15-ebook.c
@@ -77,10 +77,12 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event)
77 } 77 }
78} 78}
79 79
80#ifdef CONFIG_PM_SLEEP
80static int ebook_switch_resume(struct device *dev) 81static int ebook_switch_resume(struct device *dev)
81{ 82{
82 return ebook_send_state(to_acpi_device(dev)); 83 return ebook_send_state(to_acpi_device(dev));
83} 84}
85#endif
84 86
85static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume); 87static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume);
86 88
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index eb415bd7649..9592b936b71 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -582,6 +582,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
582void rtc_update_irq(struct rtc_device *rtc, 582void rtc_update_irq(struct rtc_device *rtc,
583 unsigned long num, unsigned long events) 583 unsigned long num, unsigned long events)
584{ 584{
585 pm_stay_awake(rtc->dev.parent);
585 schedule_work(&rtc->irqwork); 586 schedule_work(&rtc->irqwork);
586} 587}
587EXPORT_SYMBOL_GPL(rtc_update_irq); 588EXPORT_SYMBOL_GPL(rtc_update_irq);
@@ -844,6 +845,7 @@ void rtc_timer_do_work(struct work_struct *work)
844 845
845 mutex_lock(&rtc->ops_lock); 846 mutex_lock(&rtc->ops_lock);
846again: 847again:
848 pm_relax(rtc->dev.parent);
847 __rtc_read_time(rtc, &tm); 849 __rtc_read_time(rtc, &tm);
848 now = rtc_tm_to_ktime(tm); 850 now = rtc_tm_to_ktime(tm);
849 while ((next = timerqueue_getnext(&rtc->timerqueue))) { 851 while ((next = timerqueue_getnext(&rtc->timerqueue))) {
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 132333d7540..4267789ca99 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -568,7 +568,6 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
568 hpet_mask_rtc_irq_bit(RTC_AIE); 568 hpet_mask_rtc_irq_bit(RTC_AIE);
569 569
570 CMOS_READ(RTC_INTR_FLAGS); 570 CMOS_READ(RTC_INTR_FLAGS);
571 pm_wakeup_event(cmos_rtc.dev, 0);
572 } 571 }
573 spin_unlock(&rtc_lock); 572 spin_unlock(&rtc_lock);
574 573
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c147e7024f1..b8c86648a2f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -334,14 +334,6 @@ static inline void lockup_detector_init(void)
334} 334}
335#endif 335#endif
336 336
337#if defined(CONFIG_LOCKUP_DETECTOR) && defined(CONFIG_SUSPEND)
338void lockup_detector_bootcpu_resume(void);
339#else
340static inline void lockup_detector_bootcpu_resume(void)
341{
342}
343#endif
344
345#ifdef CONFIG_DETECT_HUNG_TASK 337#ifdef CONFIG_DETECT_HUNG_TASK
346extern unsigned int sysctl_hung_task_panic; 338extern unsigned int sysctl_hung_task_panic;
347extern unsigned long sysctl_hung_task_check_count; 339extern unsigned long sysctl_hung_task_check_count;
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 1da39ea248f..c8b7446b27d 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -178,9 +178,6 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
178 arch_suspend_enable_irqs(); 178 arch_suspend_enable_irqs();
179 BUG_ON(irqs_disabled()); 179 BUG_ON(irqs_disabled());
180 180
181 /* Kick the lockup detector */
182 lockup_detector_bootcpu_resume();
183
184 Enable_cpus: 181 Enable_cpus:
185 enable_nonboot_cpus(); 182 enable_nonboot_cpus();
186 183
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 69add8a9da6..4b1dfba70f7 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -575,7 +575,7 @@ out:
575/* 575/*
576 * Create/destroy watchdog threads as CPUs come and go: 576 * Create/destroy watchdog threads as CPUs come and go:
577 */ 577 */
578static int 578static int __cpuinit
579cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 579cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
580{ 580{
581 int hotcpu = (unsigned long)hcpu; 581 int hotcpu = (unsigned long)hcpu;
@@ -610,27 +610,10 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
610 return NOTIFY_OK; 610 return NOTIFY_OK;
611} 611}
612 612
613static struct notifier_block cpu_nfb = { 613static struct notifier_block __cpuinitdata cpu_nfb = {
614 .notifier_call = cpu_callback 614 .notifier_call = cpu_callback
615}; 615};
616 616
617#ifdef CONFIG_SUSPEND
618/*
619 * On exit from suspend we force an offline->online transition on the boot CPU
620 * so that the PMU state that was lost while in suspended state gets set up
621 * properly for the boot CPU. This information is required for restarting the
622 * NMI watchdog.
623 */
624void lockup_detector_bootcpu_resume(void)
625{
626 void *cpu = (void *)(long)smp_processor_id();
627
628 cpu_callback(&cpu_nfb, CPU_DEAD_FROZEN, cpu);
629 cpu_callback(&cpu_nfb, CPU_UP_PREPARE_FROZEN, cpu);
630 cpu_callback(&cpu_nfb, CPU_ONLINE_FROZEN, cpu);
631}
632#endif
633
634void __init lockup_detector_init(void) 617void __init lockup_detector_init(void)
635{ 618{
636 void *cpu = (void *)(long)smp_processor_id(); 619 void *cpu = (void *)(long)smp_processor_id();