diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:42 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:42 -0400 |
commit | bfaa07bc322085582bdc40babb9d0cce17b57380 (patch) | |
tree | 7e16d1fe32b68cb78d0a2fbe154345fbeb603648 /drivers | |
parent | 6148d38b37ce9468cdf5a37ca49b4ac5c091e8fa (diff) | |
parent | b45bae36b805287c76366c908de58b5c2c0d46b0 (diff) |
Merge branch 'pm-drivers'
* pm-drivers:
rtc-cmos: report wakeups from interrupt handler
PM / crypto / ux500: Use struct dev_pm_ops for power management
PM / IPMI: Remove empty legacy PCI PM callbacks
tpm_nsc: Use struct dev_pm_ops for power management
tpm_tis: Use struct dev_pm_ops for power management
tpm_atmel: Use struct dev_pm_ops for power management
PM / TPM: Drop unused pm_message_t argument from tpm_pm_suspend()
omap-rng: Use struct dev_pm_ops for power management
mg_disk: Use struct dev_pm_ops for power management
msi-laptop: Use struct dev_pm_ops for power management
hdaps: Use struct dev_pm_ops for power management
sonypi: Use struct dev_pm_ops for power management
intel_mid_thermal: Use struct dev_pm_ops for power management
acer-wmi: Use struct dev_pm_ops for power management
intel_ips: Remove empty legacy PM callbacks
thinkpad_acpi: Use struct dev_pm_ops instead of legacy PM routines
thinkpad_acpi: Drop pm_message_t arguments from suspend routines
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/mg_disk.c | 13 | ||||
-rw-r--r-- | drivers/char/hw_random/omap-rng.c | 13 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 16 | ||||
-rw-r--r-- | drivers/char/sonypi.c | 13 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 12 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_nsc.c | 13 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 18 | ||||
-rw-r--r-- | drivers/crypto/ux500/cryp/cryp_core.c | 39 | ||||
-rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 33 | ||||
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 10 | ||||
-rw-r--r-- | drivers/platform/x86/hdaps.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 17 | ||||
-rw-r--r-- | drivers/platform/x86/intel_mid_thermal.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/msi-laptop.c | 7 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 23 | ||||
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 1 |
18 files changed, 104 insertions, 150 deletions
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index 76fa3deaee84..1788f491e0fb 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c | |||
@@ -780,9 +780,9 @@ static const struct block_device_operations mg_disk_ops = { | |||
780 | .getgeo = mg_getgeo | 780 | .getgeo = mg_getgeo |
781 | }; | 781 | }; |
782 | 782 | ||
783 | static int mg_suspend(struct platform_device *plat_dev, pm_message_t state) | 783 | static int mg_suspend(struct device *dev) |
784 | { | 784 | { |
785 | struct mg_drv_data *prv_data = plat_dev->dev.platform_data; | 785 | struct mg_drv_data *prv_data = dev->platform_data; |
786 | struct mg_host *host = prv_data->host; | 786 | struct mg_host *host = prv_data->host; |
787 | 787 | ||
788 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) | 788 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) |
@@ -804,9 +804,9 @@ static int mg_suspend(struct platform_device *plat_dev, pm_message_t state) | |||
804 | return 0; | 804 | return 0; |
805 | } | 805 | } |
806 | 806 | ||
807 | static int mg_resume(struct platform_device *plat_dev) | 807 | static int mg_resume(struct device *dev) |
808 | { | 808 | { |
809 | struct mg_drv_data *prv_data = plat_dev->dev.platform_data; | 809 | struct mg_drv_data *prv_data = dev->platform_data; |
810 | struct mg_host *host = prv_data->host; | 810 | struct mg_host *host = prv_data->host; |
811 | 811 | ||
812 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) | 812 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) |
@@ -825,6 +825,8 @@ static int mg_resume(struct platform_device *plat_dev) | |||
825 | return 0; | 825 | return 0; |
826 | } | 826 | } |
827 | 827 | ||
828 | static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume); | ||
829 | |||
828 | static int mg_probe(struct platform_device *plat_dev) | 830 | static int mg_probe(struct platform_device *plat_dev) |
829 | { | 831 | { |
830 | struct mg_host *host; | 832 | struct mg_host *host; |
@@ -1074,11 +1076,10 @@ static int mg_remove(struct platform_device *plat_dev) | |||
1074 | static struct platform_driver mg_disk_driver = { | 1076 | static struct platform_driver mg_disk_driver = { |
1075 | .probe = mg_probe, | 1077 | .probe = mg_probe, |
1076 | .remove = mg_remove, | 1078 | .remove = mg_remove, |
1077 | .suspend = mg_suspend, | ||
1078 | .resume = mg_resume, | ||
1079 | .driver = { | 1079 | .driver = { |
1080 | .name = MG_DEV_NAME, | 1080 | .name = MG_DEV_NAME, |
1081 | .owner = THIS_MODULE, | 1081 | .owner = THIS_MODULE, |
1082 | .pm = &mg_pm, | ||
1082 | } | 1083 | } |
1083 | }; | 1084 | }; |
1084 | 1085 | ||
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 1412565c01af..d706bd0e9e80 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c | |||
@@ -162,22 +162,24 @@ static int __exit omap_rng_remove(struct platform_device *pdev) | |||
162 | 162 | ||
163 | #ifdef CONFIG_PM | 163 | #ifdef CONFIG_PM |
164 | 164 | ||
165 | static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message) | 165 | static int omap_rng_suspend(struct device *dev) |
166 | { | 166 | { |
167 | omap_rng_write_reg(RNG_MASK_REG, 0x0); | 167 | omap_rng_write_reg(RNG_MASK_REG, 0x0); |
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int omap_rng_resume(struct platform_device *pdev) | 171 | static int omap_rng_resume(struct device *dev) |
172 | { | 172 | { |
173 | omap_rng_write_reg(RNG_MASK_REG, 0x1); | 173 | omap_rng_write_reg(RNG_MASK_REG, 0x1); |
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
177 | static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); | ||
178 | #define OMAP_RNG_PM (&omap_rng_pm) | ||
179 | |||
177 | #else | 180 | #else |
178 | 181 | ||
179 | #define omap_rng_suspend NULL | 182 | #define OMAP_RNG_PM NULL |
180 | #define omap_rng_resume NULL | ||
181 | 183 | ||
182 | #endif | 184 | #endif |
183 | 185 | ||
@@ -188,11 +190,10 @@ static struct platform_driver omap_rng_driver = { | |||
188 | .driver = { | 190 | .driver = { |
189 | .name = "omap_rng", | 191 | .name = "omap_rng", |
190 | .owner = THIS_MODULE, | 192 | .owner = THIS_MODULE, |
193 | .pm = OMAP_RNG_PM, | ||
191 | }, | 194 | }, |
192 | .probe = omap_rng_probe, | 195 | .probe = omap_rng_probe, |
193 | .remove = __exit_p(omap_rng_remove), | 196 | .remove = __exit_p(omap_rng_remove), |
194 | .suspend = omap_rng_suspend, | ||
195 | .resume = omap_rng_resume | ||
196 | }; | 197 | }; |
197 | 198 | ||
198 | static int __init omap_rng_init(void) | 199 | static int __init omap_rng_init(void) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 1e638fff40ea..83f85cf7fb1b 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2503,18 +2503,6 @@ static void __devexit ipmi_pci_remove(struct pci_dev *pdev) | |||
2503 | cleanup_one_si(info); | 2503 | cleanup_one_si(info); |
2504 | } | 2504 | } |
2505 | 2505 | ||
2506 | #ifdef CONFIG_PM | ||
2507 | static int ipmi_pci_suspend(struct pci_dev *pdev, pm_message_t state) | ||
2508 | { | ||
2509 | return 0; | ||
2510 | } | ||
2511 | |||
2512 | static int ipmi_pci_resume(struct pci_dev *pdev) | ||
2513 | { | ||
2514 | return 0; | ||
2515 | } | ||
2516 | #endif | ||
2517 | |||
2518 | static struct pci_device_id ipmi_pci_devices[] = { | 2506 | static struct pci_device_id ipmi_pci_devices[] = { |
2519 | { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, | 2507 | { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, |
2520 | { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }, | 2508 | { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }, |
@@ -2527,10 +2515,6 @@ static struct pci_driver ipmi_pci_driver = { | |||
2527 | .id_table = ipmi_pci_devices, | 2515 | .id_table = ipmi_pci_devices, |
2528 | .probe = ipmi_pci_probe, | 2516 | .probe = ipmi_pci_probe, |
2529 | .remove = __devexit_p(ipmi_pci_remove), | 2517 | .remove = __devexit_p(ipmi_pci_remove), |
2530 | #ifdef CONFIG_PM | ||
2531 | .suspend = ipmi_pci_suspend, | ||
2532 | .resume = ipmi_pci_resume, | ||
2533 | #endif | ||
2534 | }; | 2518 | }; |
2535 | #endif /* CONFIG_PCI */ | 2519 | #endif /* CONFIG_PCI */ |
2536 | 2520 | ||
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 45713f0e7d61..f87780502b41 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -1459,7 +1459,7 @@ static int __devexit sonypi_remove(struct platform_device *dev) | |||
1459 | #ifdef CONFIG_PM | 1459 | #ifdef CONFIG_PM |
1460 | static int old_camera_power; | 1460 | static int old_camera_power; |
1461 | 1461 | ||
1462 | static int sonypi_suspend(struct platform_device *dev, pm_message_t state) | 1462 | static int sonypi_suspend(struct device *dev) |
1463 | { | 1463 | { |
1464 | old_camera_power = sonypi_device.camera_power; | 1464 | old_camera_power = sonypi_device.camera_power; |
1465 | sonypi_disable(); | 1465 | sonypi_disable(); |
@@ -1467,14 +1467,16 @@ static int sonypi_suspend(struct platform_device *dev, pm_message_t state) | |||
1467 | return 0; | 1467 | return 0; |
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | static int sonypi_resume(struct platform_device *dev) | 1470 | static int sonypi_resume(struct device *dev) |
1471 | { | 1471 | { |
1472 | sonypi_enable(old_camera_power); | 1472 | sonypi_enable(old_camera_power); |
1473 | return 0; | 1473 | return 0; |
1474 | } | 1474 | } |
1475 | |||
1476 | static SIMPLE_DEV_PM_OPS(sonypi_pm, sonypi_suspend, sonypi_resume); | ||
1477 | #define SONYPI_PM (&sonypi_pm) | ||
1475 | #else | 1478 | #else |
1476 | #define sonypi_suspend NULL | 1479 | #define SONYPI_PM NULL |
1477 | #define sonypi_resume NULL | ||
1478 | #endif | 1480 | #endif |
1479 | 1481 | ||
1480 | static void sonypi_shutdown(struct platform_device *dev) | 1482 | static void sonypi_shutdown(struct platform_device *dev) |
@@ -1486,12 +1488,11 @@ static struct platform_driver sonypi_driver = { | |||
1486 | .driver = { | 1488 | .driver = { |
1487 | .name = "sonypi", | 1489 | .name = "sonypi", |
1488 | .owner = THIS_MODULE, | 1490 | .owner = THIS_MODULE, |
1491 | .pm = SONYPI_PM, | ||
1489 | }, | 1492 | }, |
1490 | .probe = sonypi_probe, | 1493 | .probe = sonypi_probe, |
1491 | .remove = __devexit_p(sonypi_remove), | 1494 | .remove = __devexit_p(sonypi_remove), |
1492 | .shutdown = sonypi_shutdown, | 1495 | .shutdown = sonypi_shutdown, |
1493 | .suspend = sonypi_suspend, | ||
1494 | .resume = sonypi_resume, | ||
1495 | }; | 1496 | }; |
1496 | 1497 | ||
1497 | static struct platform_device *sonypi_platform_device; | 1498 | static struct platform_device *sonypi_platform_device; |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index ad7c7320dd1b..ae43ac55fc1e 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1274,7 +1274,7 @@ static struct tpm_input_header savestate_header = { | |||
1274 | * We are about to suspend. Save the TPM state | 1274 | * We are about to suspend. Save the TPM state |
1275 | * so that it can be restored. | 1275 | * so that it can be restored. |
1276 | */ | 1276 | */ |
1277 | int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) | 1277 | int tpm_pm_suspend(struct device *dev) |
1278 | { | 1278 | { |
1279 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1279 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1280 | struct tpm_cmd_t cmd; | 1280 | struct tpm_cmd_t cmd; |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index b1c5280ac159..917f727e6740 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -299,7 +299,7 @@ extern ssize_t tpm_write(struct file *, const char __user *, size_t, | |||
299 | loff_t *); | 299 | loff_t *); |
300 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); | 300 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); |
301 | extern void tpm_remove_hardware(struct device *); | 301 | extern void tpm_remove_hardware(struct device *); |
302 | extern int tpm_pm_suspend(struct device *, pm_message_t); | 302 | extern int tpm_pm_suspend(struct device *); |
303 | extern int tpm_pm_resume(struct device *); | 303 | extern int tpm_pm_resume(struct device *); |
304 | extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long, | 304 | extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long, |
305 | wait_queue_head_t *); | 305 | wait_queue_head_t *); |
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index c64a1bc65349..678d57019dc4 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c | |||
@@ -168,22 +168,14 @@ static void atml_plat_remove(void) | |||
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
171 | static int tpm_atml_suspend(struct platform_device *dev, pm_message_t msg) | 171 | static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume); |
172 | { | ||
173 | return tpm_pm_suspend(&dev->dev, msg); | ||
174 | } | ||
175 | 172 | ||
176 | static int tpm_atml_resume(struct platform_device *dev) | ||
177 | { | ||
178 | return tpm_pm_resume(&dev->dev); | ||
179 | } | ||
180 | static struct platform_driver atml_drv = { | 173 | static struct platform_driver atml_drv = { |
181 | .driver = { | 174 | .driver = { |
182 | .name = "tpm_atmel", | 175 | .name = "tpm_atmel", |
183 | .owner = THIS_MODULE, | 176 | .owner = THIS_MODULE, |
177 | .pm = &tpm_atml_pm, | ||
184 | }, | 178 | }, |
185 | .suspend = tpm_atml_suspend, | ||
186 | .resume = tpm_atml_resume, | ||
187 | }; | 179 | }; |
188 | 180 | ||
189 | static int __init init_atmel(void) | 181 | static int __init init_atmel(void) |
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 4d2464871ada..640c9a427b59 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -274,22 +274,13 @@ static void tpm_nsc_remove(struct device *dev) | |||
274 | } | 274 | } |
275 | } | 275 | } |
276 | 276 | ||
277 | static int tpm_nsc_suspend(struct platform_device *dev, pm_message_t msg) | 277 | static SIMPLE_DEV_PM_OPS(tpm_nsc_pm, tpm_pm_suspend, tpm_pm_resume); |
278 | { | ||
279 | return tpm_pm_suspend(&dev->dev, msg); | ||
280 | } | ||
281 | |||
282 | static int tpm_nsc_resume(struct platform_device *dev) | ||
283 | { | ||
284 | return tpm_pm_resume(&dev->dev); | ||
285 | } | ||
286 | 278 | ||
287 | static struct platform_driver nsc_drv = { | 279 | static struct platform_driver nsc_drv = { |
288 | .suspend = tpm_nsc_suspend, | ||
289 | .resume = tpm_nsc_resume, | ||
290 | .driver = { | 280 | .driver = { |
291 | .name = "tpm_nsc", | 281 | .name = "tpm_nsc", |
292 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .pm = &tpm_nsc_pm, | ||
293 | }, | 284 | }, |
294 | }; | 285 | }; |
295 | 286 | ||
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index d2a70cae76df..89682fa8801e 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -750,7 +750,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | |||
750 | 750 | ||
751 | static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | 751 | static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) |
752 | { | 752 | { |
753 | return tpm_pm_suspend(&dev->dev, msg); | 753 | return tpm_pm_suspend(&dev->dev); |
754 | } | 754 | } |
755 | 755 | ||
756 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 756 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
@@ -806,27 +806,25 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, | |||
806 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); | 806 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); |
807 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); | 807 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); |
808 | #endif | 808 | #endif |
809 | static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) | ||
810 | { | ||
811 | return tpm_pm_suspend(&dev->dev, msg); | ||
812 | } | ||
813 | 809 | ||
814 | static int tpm_tis_resume(struct platform_device *dev) | 810 | static int tpm_tis_resume(struct device *dev) |
815 | { | 811 | { |
816 | struct tpm_chip *chip = dev_get_drvdata(&dev->dev); | 812 | struct tpm_chip *chip = dev_get_drvdata(dev); |
817 | 813 | ||
818 | if (chip->vendor.irq) | 814 | if (chip->vendor.irq) |
819 | tpm_tis_reenable_interrupts(chip); | 815 | tpm_tis_reenable_interrupts(chip); |
820 | 816 | ||
821 | return tpm_pm_resume(&dev->dev); | 817 | return tpm_pm_resume(dev); |
822 | } | 818 | } |
819 | |||
820 | static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_resume); | ||
821 | |||
823 | static struct platform_driver tis_drv = { | 822 | static struct platform_driver tis_drv = { |
824 | .driver = { | 823 | .driver = { |
825 | .name = "tpm_tis", | 824 | .name = "tpm_tis", |
826 | .owner = THIS_MODULE, | 825 | .owner = THIS_MODULE, |
826 | .pm = &tpm_tis_pm, | ||
827 | }, | 827 | }, |
828 | .suspend = tpm_tis_suspend, | ||
829 | .resume = tpm_tis_resume, | ||
830 | }; | 828 | }; |
831 | 829 | ||
832 | static struct platform_device *pdev; | 830 | static struct platform_device *pdev; |
diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 7cac12793a4b..1c307e1b840c 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c | |||
@@ -1661,27 +1661,26 @@ static void ux500_cryp_shutdown(struct platform_device *pdev) | |||
1661 | 1661 | ||
1662 | } | 1662 | } |
1663 | 1663 | ||
1664 | static int ux500_cryp_suspend(struct platform_device *pdev, pm_message_t state) | 1664 | static int ux500_cryp_suspend(struct device *dev) |
1665 | { | 1665 | { |
1666 | int ret; | 1666 | int ret; |
1667 | struct platform_device *pdev = to_platform_device(dev); | ||
1667 | struct cryp_device_data *device_data; | 1668 | struct cryp_device_data *device_data; |
1668 | struct resource *res_irq; | 1669 | struct resource *res_irq; |
1669 | struct cryp_ctx *temp_ctx = NULL; | 1670 | struct cryp_ctx *temp_ctx = NULL; |
1670 | 1671 | ||
1671 | dev_dbg(&pdev->dev, "[%s]", __func__); | 1672 | dev_dbg(dev, "[%s]", __func__); |
1672 | 1673 | ||
1673 | /* Handle state? */ | 1674 | /* Handle state? */ |
1674 | device_data = platform_get_drvdata(pdev); | 1675 | device_data = platform_get_drvdata(pdev); |
1675 | if (!device_data) { | 1676 | if (!device_data) { |
1676 | dev_err(&pdev->dev, "[%s]: platform_get_drvdata() failed!", | 1677 | dev_err(dev, "[%s]: platform_get_drvdata() failed!", __func__); |
1677 | __func__); | ||
1678 | return -ENOMEM; | 1678 | return -ENOMEM; |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 1681 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
1682 | if (!res_irq) | 1682 | if (!res_irq) |
1683 | dev_err(&pdev->dev, "[%s]: IORESOURCE_IRQ, unavailable", | 1683 | dev_err(dev, "[%s]: IORESOURCE_IRQ, unavailable", __func__); |
1684 | __func__); | ||
1685 | else | 1684 | else |
1686 | disable_irq(res_irq->start); | 1685 | disable_irq(res_irq->start); |
1687 | 1686 | ||
@@ -1692,32 +1691,32 @@ static int ux500_cryp_suspend(struct platform_device *pdev, pm_message_t state) | |||
1692 | 1691 | ||
1693 | if (device_data->current_ctx == ++temp_ctx) { | 1692 | if (device_data->current_ctx == ++temp_ctx) { |
1694 | if (down_interruptible(&driver_data.device_allocation)) | 1693 | if (down_interruptible(&driver_data.device_allocation)) |
1695 | dev_dbg(&pdev->dev, "[%s]: down_interruptible() " | 1694 | dev_dbg(dev, "[%s]: down_interruptible() failed", |
1696 | "failed", __func__); | 1695 | __func__); |
1697 | ret = cryp_disable_power(&pdev->dev, device_data, false); | 1696 | ret = cryp_disable_power(dev, device_data, false); |
1698 | 1697 | ||
1699 | } else | 1698 | } else |
1700 | ret = cryp_disable_power(&pdev->dev, device_data, true); | 1699 | ret = cryp_disable_power(dev, device_data, true); |
1701 | 1700 | ||
1702 | if (ret) | 1701 | if (ret) |
1703 | dev_err(&pdev->dev, "[%s]: cryp_disable_power()", __func__); | 1702 | dev_err(dev, "[%s]: cryp_disable_power()", __func__); |
1704 | 1703 | ||
1705 | return ret; | 1704 | return ret; |
1706 | } | 1705 | } |
1707 | 1706 | ||
1708 | static int ux500_cryp_resume(struct platform_device *pdev) | 1707 | static int ux500_cryp_resume(struct device *dev) |
1709 | { | 1708 | { |
1710 | int ret = 0; | 1709 | int ret = 0; |
1710 | struct platform_device *pdev = to_platform_device(dev); | ||
1711 | struct cryp_device_data *device_data; | 1711 | struct cryp_device_data *device_data; |
1712 | struct resource *res_irq; | 1712 | struct resource *res_irq; |
1713 | struct cryp_ctx *temp_ctx = NULL; | 1713 | struct cryp_ctx *temp_ctx = NULL; |
1714 | 1714 | ||
1715 | dev_dbg(&pdev->dev, "[%s]", __func__); | 1715 | dev_dbg(dev, "[%s]", __func__); |
1716 | 1716 | ||
1717 | device_data = platform_get_drvdata(pdev); | 1717 | device_data = platform_get_drvdata(pdev); |
1718 | if (!device_data) { | 1718 | if (!device_data) { |
1719 | dev_err(&pdev->dev, "[%s]: platform_get_drvdata() failed!", | 1719 | dev_err(dev, "[%s]: platform_get_drvdata() failed!", __func__); |
1720 | __func__); | ||
1721 | return -ENOMEM; | 1720 | return -ENOMEM; |
1722 | } | 1721 | } |
1723 | 1722 | ||
@@ -1730,11 +1729,10 @@ static int ux500_cryp_resume(struct platform_device *pdev) | |||
1730 | if (!device_data->current_ctx) | 1729 | if (!device_data->current_ctx) |
1731 | up(&driver_data.device_allocation); | 1730 | up(&driver_data.device_allocation); |
1732 | else | 1731 | else |
1733 | ret = cryp_enable_power(&pdev->dev, device_data, true); | 1732 | ret = cryp_enable_power(dev, device_data, true); |
1734 | 1733 | ||
1735 | if (ret) | 1734 | if (ret) |
1736 | dev_err(&pdev->dev, "[%s]: cryp_enable_power() failed!", | 1735 | dev_err(dev, "[%s]: cryp_enable_power() failed!", __func__); |
1737 | __func__); | ||
1738 | else { | 1736 | else { |
1739 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 1737 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
1740 | if (res_irq) | 1738 | if (res_irq) |
@@ -1744,15 +1742,16 @@ static int ux500_cryp_resume(struct platform_device *pdev) | |||
1744 | return ret; | 1742 | return ret; |
1745 | } | 1743 | } |
1746 | 1744 | ||
1745 | static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume); | ||
1746 | |||
1747 | static struct platform_driver cryp_driver = { | 1747 | static struct platform_driver cryp_driver = { |
1748 | .probe = ux500_cryp_probe, | 1748 | .probe = ux500_cryp_probe, |
1749 | .remove = ux500_cryp_remove, | 1749 | .remove = ux500_cryp_remove, |
1750 | .shutdown = ux500_cryp_shutdown, | 1750 | .shutdown = ux500_cryp_shutdown, |
1751 | .suspend = ux500_cryp_suspend, | ||
1752 | .resume = ux500_cryp_resume, | ||
1753 | .driver = { | 1751 | .driver = { |
1754 | .owner = THIS_MODULE, | 1752 | .owner = THIS_MODULE, |
1755 | .name = "cryp1" | 1753 | .name = "cryp1" |
1754 | .pm = &ux500_cryp_pm, | ||
1756 | } | 1755 | } |
1757 | }; | 1756 | }; |
1758 | 1757 | ||
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 6dbb9ec709a3..08d5032cb564 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c | |||
@@ -1894,19 +1894,17 @@ static void ux500_hash_shutdown(struct platform_device *pdev) | |||
1894 | 1894 | ||
1895 | /** | 1895 | /** |
1896 | * ux500_hash_suspend - Function that suspends the hash device. | 1896 | * ux500_hash_suspend - Function that suspends the hash device. |
1897 | * @pdev: The platform device. | 1897 | * @dev: Device to suspend. |
1898 | * @state: - | ||
1899 | */ | 1898 | */ |
1900 | static int ux500_hash_suspend(struct platform_device *pdev, pm_message_t state) | 1899 | static int ux500_hash_suspend(struct device *dev) |
1901 | { | 1900 | { |
1902 | int ret; | 1901 | int ret; |
1903 | struct hash_device_data *device_data; | 1902 | struct hash_device_data *device_data; |
1904 | struct hash_ctx *temp_ctx = NULL; | 1903 | struct hash_ctx *temp_ctx = NULL; |
1905 | 1904 | ||
1906 | device_data = platform_get_drvdata(pdev); | 1905 | device_data = dev_get_drvdata(dev); |
1907 | if (!device_data) { | 1906 | if (!device_data) { |
1908 | dev_err(&pdev->dev, "[%s] platform_get_drvdata() failed!", | 1907 | dev_err(dev, "[%s] platform_get_drvdata() failed!", __func__); |
1909 | __func__); | ||
1910 | return -ENOMEM; | 1908 | return -ENOMEM; |
1911 | } | 1909 | } |
1912 | 1910 | ||
@@ -1917,33 +1915,32 @@ static int ux500_hash_suspend(struct platform_device *pdev, pm_message_t state) | |||
1917 | 1915 | ||
1918 | if (device_data->current_ctx == ++temp_ctx) { | 1916 | if (device_data->current_ctx == ++temp_ctx) { |
1919 | if (down_interruptible(&driver_data.device_allocation)) | 1917 | if (down_interruptible(&driver_data.device_allocation)) |
1920 | dev_dbg(&pdev->dev, "[%s]: down_interruptible() " | 1918 | dev_dbg(dev, "[%s]: down_interruptible() failed", |
1921 | "failed", __func__); | 1919 | __func__); |
1922 | ret = hash_disable_power(device_data, false); | 1920 | ret = hash_disable_power(device_data, false); |
1923 | 1921 | ||
1924 | } else | 1922 | } else |
1925 | ret = hash_disable_power(device_data, true); | 1923 | ret = hash_disable_power(device_data, true); |
1926 | 1924 | ||
1927 | if (ret) | 1925 | if (ret) |
1928 | dev_err(&pdev->dev, "[%s]: hash_disable_power()", __func__); | 1926 | dev_err(dev, "[%s]: hash_disable_power()", __func__); |
1929 | 1927 | ||
1930 | return ret; | 1928 | return ret; |
1931 | } | 1929 | } |
1932 | 1930 | ||
1933 | /** | 1931 | /** |
1934 | * ux500_hash_resume - Function that resume the hash device. | 1932 | * ux500_hash_resume - Function that resume the hash device. |
1935 | * @pdev: The platform device. | 1933 | * @dev: Device to resume. |
1936 | */ | 1934 | */ |
1937 | static int ux500_hash_resume(struct platform_device *pdev) | 1935 | static int ux500_hash_resume(struct device *dev) |
1938 | { | 1936 | { |
1939 | int ret = 0; | 1937 | int ret = 0; |
1940 | struct hash_device_data *device_data; | 1938 | struct hash_device_data *device_data; |
1941 | struct hash_ctx *temp_ctx = NULL; | 1939 | struct hash_ctx *temp_ctx = NULL; |
1942 | 1940 | ||
1943 | device_data = platform_get_drvdata(pdev); | 1941 | device_data = dev_get_drvdata(dev); |
1944 | if (!device_data) { | 1942 | if (!device_data) { |
1945 | dev_err(&pdev->dev, "[%s] platform_get_drvdata() failed!", | 1943 | dev_err(dev, "[%s] platform_get_drvdata() failed!", __func__); |
1946 | __func__); | ||
1947 | return -ENOMEM; | 1944 | return -ENOMEM; |
1948 | } | 1945 | } |
1949 | 1946 | ||
@@ -1958,21 +1955,21 @@ static int ux500_hash_resume(struct platform_device *pdev) | |||
1958 | ret = hash_enable_power(device_data, true); | 1955 | ret = hash_enable_power(device_data, true); |
1959 | 1956 | ||
1960 | if (ret) | 1957 | if (ret) |
1961 | dev_err(&pdev->dev, "[%s]: hash_enable_power() failed!", | 1958 | dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); |
1962 | __func__); | ||
1963 | 1959 | ||
1964 | return ret; | 1960 | return ret; |
1965 | } | 1961 | } |
1966 | 1962 | ||
1963 | static SIMPLE_DEV_PM_OPS(ux500_hash_pm, ux500_hash_suspend, ux500_hash_resume); | ||
1964 | |||
1967 | static struct platform_driver hash_driver = { | 1965 | static struct platform_driver hash_driver = { |
1968 | .probe = ux500_hash_probe, | 1966 | .probe = ux500_hash_probe, |
1969 | .remove = ux500_hash_remove, | 1967 | .remove = ux500_hash_remove, |
1970 | .shutdown = ux500_hash_shutdown, | 1968 | .shutdown = ux500_hash_shutdown, |
1971 | .suspend = ux500_hash_suspend, | ||
1972 | .resume = ux500_hash_resume, | ||
1973 | .driver = { | 1969 | .driver = { |
1974 | .owner = THIS_MODULE, | 1970 | .owner = THIS_MODULE, |
1975 | .name = "hash1", | 1971 | .name = "hash1", |
1972 | .pm = &ux500_hash_pm, | ||
1976 | } | 1973 | } |
1977 | }; | 1974 | }; |
1978 | 1975 | ||
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index ce875dc365e5..c8f40c9c0428 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -1877,8 +1877,7 @@ static int acer_platform_remove(struct platform_device *device) | |||
1877 | return 0; | 1877 | return 0; |
1878 | } | 1878 | } |
1879 | 1879 | ||
1880 | static int acer_platform_suspend(struct platform_device *dev, | 1880 | static int acer_suspend(struct device *dev) |
1881 | pm_message_t state) | ||
1882 | { | 1881 | { |
1883 | u32 value; | 1882 | u32 value; |
1884 | struct acer_data *data = &interface->data; | 1883 | struct acer_data *data = &interface->data; |
@@ -1900,7 +1899,7 @@ pm_message_t state) | |||
1900 | return 0; | 1899 | return 0; |
1901 | } | 1900 | } |
1902 | 1901 | ||
1903 | static int acer_platform_resume(struct platform_device *device) | 1902 | static int acer_resume(struct device *dev) |
1904 | { | 1903 | { |
1905 | struct acer_data *data = &interface->data; | 1904 | struct acer_data *data = &interface->data; |
1906 | 1905 | ||
@@ -1916,6 +1915,8 @@ static int acer_platform_resume(struct platform_device *device) | |||
1916 | return 0; | 1915 | return 0; |
1917 | } | 1916 | } |
1918 | 1917 | ||
1918 | static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume); | ||
1919 | |||
1919 | static void acer_platform_shutdown(struct platform_device *device) | 1920 | static void acer_platform_shutdown(struct platform_device *device) |
1920 | { | 1921 | { |
1921 | struct acer_data *data = &interface->data; | 1922 | struct acer_data *data = &interface->data; |
@@ -1931,11 +1932,10 @@ static struct platform_driver acer_platform_driver = { | |||
1931 | .driver = { | 1932 | .driver = { |
1932 | .name = "acer-wmi", | 1933 | .name = "acer-wmi", |
1933 | .owner = THIS_MODULE, | 1934 | .owner = THIS_MODULE, |
1935 | .pm = &acer_pm, | ||
1934 | }, | 1936 | }, |
1935 | .probe = acer_platform_probe, | 1937 | .probe = acer_platform_probe, |
1936 | .remove = acer_platform_remove, | 1938 | .remove = acer_platform_remove, |
1937 | .suspend = acer_platform_suspend, | ||
1938 | .resume = acer_platform_resume, | ||
1939 | .shutdown = acer_platform_shutdown, | 1939 | .shutdown = acer_platform_shutdown, |
1940 | }; | 1940 | }; |
1941 | 1941 | ||
diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c index 24a3ae065f1b..d9ab6f64dcec 100644 --- a/drivers/platform/x86/hdaps.c +++ b/drivers/platform/x86/hdaps.c | |||
@@ -305,17 +305,19 @@ static int hdaps_probe(struct platform_device *dev) | |||
305 | return 0; | 305 | return 0; |
306 | } | 306 | } |
307 | 307 | ||
308 | static int hdaps_resume(struct platform_device *dev) | 308 | static int hdaps_resume(struct device *dev) |
309 | { | 309 | { |
310 | return hdaps_device_init(); | 310 | return hdaps_device_init(); |
311 | } | 311 | } |
312 | 312 | ||
313 | static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume); | ||
314 | |||
313 | static struct platform_driver hdaps_driver = { | 315 | static struct platform_driver hdaps_driver = { |
314 | .probe = hdaps_probe, | 316 | .probe = hdaps_probe, |
315 | .resume = hdaps_resume, | ||
316 | .driver = { | 317 | .driver = { |
317 | .name = "hdaps", | 318 | .name = "hdaps", |
318 | .owner = THIS_MODULE, | 319 | .owner = THIS_MODULE, |
320 | .pm = &hdaps_pm, | ||
319 | }, | 321 | }, |
320 | }; | 322 | }; |
321 | 323 | ||
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 0ffdb3cde2bb..bd89f3c8e76e 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -1697,21 +1697,6 @@ static void ips_remove(struct pci_dev *dev) | |||
1697 | dev_dbg(&dev->dev, "IPS driver removed\n"); | 1697 | dev_dbg(&dev->dev, "IPS driver removed\n"); |
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | #ifdef CONFIG_PM | ||
1701 | static int ips_suspend(struct pci_dev *dev, pm_message_t state) | ||
1702 | { | ||
1703 | return 0; | ||
1704 | } | ||
1705 | |||
1706 | static int ips_resume(struct pci_dev *dev) | ||
1707 | { | ||
1708 | return 0; | ||
1709 | } | ||
1710 | #else | ||
1711 | #define ips_suspend NULL | ||
1712 | #define ips_resume NULL | ||
1713 | #endif /* CONFIG_PM */ | ||
1714 | |||
1715 | static void ips_shutdown(struct pci_dev *dev) | 1700 | static void ips_shutdown(struct pci_dev *dev) |
1716 | { | 1701 | { |
1717 | } | 1702 | } |
@@ -1721,8 +1706,6 @@ static struct pci_driver ips_pci_driver = { | |||
1721 | .id_table = ips_id_table, | 1706 | .id_table = ips_id_table, |
1722 | .probe = ips_probe, | 1707 | .probe = ips_probe, |
1723 | .remove = ips_remove, | 1708 | .remove = ips_remove, |
1724 | .suspend = ips_suspend, | ||
1725 | .resume = ips_resume, | ||
1726 | .shutdown = ips_shutdown, | 1709 | .shutdown = ips_shutdown, |
1727 | }; | 1710 | }; |
1728 | 1711 | ||
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c index 5ae9cd9c7e6e..ea7422f6fa03 100644 --- a/drivers/platform/x86/intel_mid_thermal.c +++ b/drivers/platform/x86/intel_mid_thermal.c | |||
@@ -418,23 +418,23 @@ static struct thermal_device_info *initialize_sensor(int index) | |||
418 | 418 | ||
419 | /** | 419 | /** |
420 | * mid_thermal_resume - resume routine | 420 | * mid_thermal_resume - resume routine |
421 | * @pdev: platform device structure | 421 | * @dev: device structure |
422 | * | 422 | * |
423 | * mid thermal resume: re-initializes the adc. Can sleep. | 423 | * mid thermal resume: re-initializes the adc. Can sleep. |
424 | */ | 424 | */ |
425 | static int mid_thermal_resume(struct platform_device *pdev) | 425 | static int mid_thermal_resume(struct device *dev) |
426 | { | 426 | { |
427 | return mid_initialize_adc(&pdev->dev); | 427 | return mid_initialize_adc(dev); |
428 | } | 428 | } |
429 | 429 | ||
430 | /** | 430 | /** |
431 | * mid_thermal_suspend - suspend routine | 431 | * mid_thermal_suspend - suspend routine |
432 | * @pdev: platform device structure | 432 | * @dev: device structure |
433 | * | 433 | * |
434 | * mid thermal suspend implements the suspend functionality | 434 | * mid thermal suspend implements the suspend functionality |
435 | * by stopping the ADC. Can sleep. | 435 | * by stopping the ADC. Can sleep. |
436 | */ | 436 | */ |
437 | static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) | 437 | static int mid_thermal_suspend(struct device *dev) |
438 | { | 438 | { |
439 | /* | 439 | /* |
440 | * This just stops the ADC and does not disable it. | 440 | * This just stops the ADC and does not disable it. |
@@ -444,6 +444,9 @@ static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
444 | return configure_adc(0); | 444 | return configure_adc(0); |
445 | } | 445 | } |
446 | 446 | ||
447 | static SIMPLE_DEV_PM_OPS(mid_thermal_pm, | ||
448 | mid_thermal_suspend, mid_thermal_resume); | ||
449 | |||
447 | /** | 450 | /** |
448 | * read_curr_temp - reads the current temperature and stores in temp | 451 | * read_curr_temp - reads the current temperature and stores in temp |
449 | * @temp: holds the current temperature value after reading | 452 | * @temp: holds the current temperature value after reading |
@@ -557,10 +560,9 @@ static struct platform_driver mid_thermal_driver = { | |||
557 | .driver = { | 560 | .driver = { |
558 | .name = DRIVER_NAME, | 561 | .name = DRIVER_NAME, |
559 | .owner = THIS_MODULE, | 562 | .owner = THIS_MODULE, |
563 | .pm = &mid_thermal_pm, | ||
560 | }, | 564 | }, |
561 | .probe = mid_thermal_probe, | 565 | .probe = mid_thermal_probe, |
562 | .suspend = mid_thermal_suspend, | ||
563 | .resume = mid_thermal_resume, | ||
564 | .remove = __devexit_p(mid_thermal_remove), | 566 | .remove = __devexit_p(mid_thermal_remove), |
565 | .id_table = therm_id_table, | 567 | .id_table = therm_id_table, |
566 | }; | 568 | }; |
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index bb5132128b33..f64441844317 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c | |||
@@ -85,7 +85,8 @@ | |||
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 | static int msi_laptop_resume(struct platform_device *device); | 88 | static int msi_laptop_resume(struct device *device); |
89 | static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume); | ||
89 | 90 | ||
90 | #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f | 91 | #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f |
91 | 92 | ||
@@ -437,8 +438,8 @@ static struct platform_driver msipf_driver = { | |||
437 | .driver = { | 438 | .driver = { |
438 | .name = "msi-laptop-pf", | 439 | .name = "msi-laptop-pf", |
439 | .owner = THIS_MODULE, | 440 | .owner = THIS_MODULE, |
441 | .pm = &msi_laptop_pm, | ||
440 | }, | 442 | }, |
441 | .resume = msi_laptop_resume, | ||
442 | }; | 443 | }; |
443 | 444 | ||
444 | static struct platform_device *msipf_device; | 445 | static struct platform_device *msipf_device; |
@@ -752,7 +753,7 @@ err_bluetooth: | |||
752 | return retval; | 753 | return retval; |
753 | } | 754 | } |
754 | 755 | ||
755 | static int msi_laptop_resume(struct platform_device *device) | 756 | static int msi_laptop_resume(struct device *device) |
756 | { | 757 | { |
757 | u8 data; | 758 | u8 data; |
758 | int result; | 759 | int result; |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 8b5610d88418..d5fd4a1193f8 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -277,7 +277,7 @@ struct ibm_struct { | |||
277 | int (*write) (char *); | 277 | int (*write) (char *); |
278 | void (*exit) (void); | 278 | void (*exit) (void); |
279 | void (*resume) (void); | 279 | void (*resume) (void); |
280 | void (*suspend) (pm_message_t state); | 280 | void (*suspend) (void); |
281 | void (*shutdown) (void); | 281 | void (*shutdown) (void); |
282 | 282 | ||
283 | struct list_head all_drivers; | 283 | struct list_head all_drivers; |
@@ -922,8 +922,7 @@ static struct input_dev *tpacpi_inputdev; | |||
922 | static struct mutex tpacpi_inputdev_send_mutex; | 922 | static struct mutex tpacpi_inputdev_send_mutex; |
923 | static LIST_HEAD(tpacpi_all_drivers); | 923 | static LIST_HEAD(tpacpi_all_drivers); |
924 | 924 | ||
925 | static int tpacpi_suspend_handler(struct platform_device *pdev, | 925 | static int tpacpi_suspend_handler(struct device *dev) |
926 | pm_message_t state) | ||
927 | { | 926 | { |
928 | struct ibm_struct *ibm, *itmp; | 927 | struct ibm_struct *ibm, *itmp; |
929 | 928 | ||
@@ -931,13 +930,13 @@ static int tpacpi_suspend_handler(struct platform_device *pdev, | |||
931 | &tpacpi_all_drivers, | 930 | &tpacpi_all_drivers, |
932 | all_drivers) { | 931 | all_drivers) { |
933 | if (ibm->suspend) | 932 | if (ibm->suspend) |
934 | (ibm->suspend)(state); | 933 | (ibm->suspend)(); |
935 | } | 934 | } |
936 | 935 | ||
937 | return 0; | 936 | return 0; |
938 | } | 937 | } |
939 | 938 | ||
940 | static int tpacpi_resume_handler(struct platform_device *pdev) | 939 | static int tpacpi_resume_handler(struct device *dev) |
941 | { | 940 | { |
942 | struct ibm_struct *ibm, *itmp; | 941 | struct ibm_struct *ibm, *itmp; |
943 | 942 | ||
@@ -951,6 +950,9 @@ static int tpacpi_resume_handler(struct platform_device *pdev) | |||
951 | return 0; | 950 | return 0; |
952 | } | 951 | } |
953 | 952 | ||
953 | static SIMPLE_DEV_PM_OPS(tpacpi_pm, | ||
954 | tpacpi_suspend_handler, tpacpi_resume_handler); | ||
955 | |||
954 | static void tpacpi_shutdown_handler(struct platform_device *pdev) | 956 | static void tpacpi_shutdown_handler(struct platform_device *pdev) |
955 | { | 957 | { |
956 | struct ibm_struct *ibm, *itmp; | 958 | struct ibm_struct *ibm, *itmp; |
@@ -967,9 +969,8 @@ static struct platform_driver tpacpi_pdriver = { | |||
967 | .driver = { | 969 | .driver = { |
968 | .name = TPACPI_DRVR_NAME, | 970 | .name = TPACPI_DRVR_NAME, |
969 | .owner = THIS_MODULE, | 971 | .owner = THIS_MODULE, |
972 | .pm = &tpacpi_pm, | ||
970 | }, | 973 | }, |
971 | .suspend = tpacpi_suspend_handler, | ||
972 | .resume = tpacpi_resume_handler, | ||
973 | .shutdown = tpacpi_shutdown_handler, | 974 | .shutdown = tpacpi_shutdown_handler, |
974 | }; | 975 | }; |
975 | 976 | ||
@@ -3758,7 +3759,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
3758 | } | 3759 | } |
3759 | } | 3760 | } |
3760 | 3761 | ||
3761 | static void hotkey_suspend(pm_message_t state) | 3762 | static void hotkey_suspend(void) |
3762 | { | 3763 | { |
3763 | /* Do these on suspend, we get the events on early resume! */ | 3764 | /* Do these on suspend, we get the events on early resume! */ |
3764 | hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; | 3765 | hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; |
@@ -6329,7 +6330,7 @@ static int __init brightness_init(struct ibm_init_struct *iibm) | |||
6329 | return 0; | 6330 | return 0; |
6330 | } | 6331 | } |
6331 | 6332 | ||
6332 | static void brightness_suspend(pm_message_t state) | 6333 | static void brightness_suspend(void) |
6333 | { | 6334 | { |
6334 | tpacpi_brightness_checkpoint_nvram(); | 6335 | tpacpi_brightness_checkpoint_nvram(); |
6335 | } | 6336 | } |
@@ -6748,7 +6749,7 @@ static struct snd_kcontrol_new volume_alsa_control_mute __devinitdata = { | |||
6748 | .get = volume_alsa_mute_get, | 6749 | .get = volume_alsa_mute_get, |
6749 | }; | 6750 | }; |
6750 | 6751 | ||
6751 | static void volume_suspend(pm_message_t state) | 6752 | static void volume_suspend(void) |
6752 | { | 6753 | { |
6753 | tpacpi_volume_checkpoint_nvram(); | 6754 | tpacpi_volume_checkpoint_nvram(); |
6754 | } | 6755 | } |
@@ -8107,7 +8108,7 @@ static void fan_exit(void) | |||
8107 | flush_workqueue(tpacpi_wq); | 8108 | flush_workqueue(tpacpi_wq); |
8108 | } | 8109 | } |
8109 | 8110 | ||
8110 | static void fan_suspend(pm_message_t state) | 8111 | static void fan_suspend(void) |
8111 | { | 8112 | { |
8112 | int rc; | 8113 | int rc; |
8113 | 8114 | ||
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 4267789ca995..132333d75408 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -568,6 +568,7 @@ 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); | ||
571 | } | 572 | } |
572 | spin_unlock(&rtc_lock); | 573 | spin_unlock(&rtc_lock); |
573 | 574 | ||