diff options
38 files changed, 191 insertions, 2 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 1539734bbbad..43cc43d7b591 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -219,10 +219,12 @@ static void ahci_thaw(struct ata_port *ap); | |||
219 | static void ahci_error_handler(struct ata_port *ap); | 219 | static void ahci_error_handler(struct ata_port *ap); |
220 | static void ahci_vt8251_error_handler(struct ata_port *ap); | 220 | static void ahci_vt8251_error_handler(struct ata_port *ap); |
221 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); | 221 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); |
222 | #ifdef CONFIG_PM | ||
222 | static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg); | 223 | static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg); |
223 | static int ahci_port_resume(struct ata_port *ap); | 224 | static int ahci_port_resume(struct ata_port *ap); |
224 | static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); | 225 | static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); |
225 | static int ahci_pci_device_resume(struct pci_dev *pdev); | 226 | static int ahci_pci_device_resume(struct pci_dev *pdev); |
227 | #endif | ||
226 | 228 | ||
227 | static struct scsi_host_template ahci_sht = { | 229 | static struct scsi_host_template ahci_sht = { |
228 | .module = THIS_MODULE, | 230 | .module = THIS_MODULE, |
@@ -241,8 +243,10 @@ static struct scsi_host_template ahci_sht = { | |||
241 | .slave_configure = ata_scsi_slave_config, | 243 | .slave_configure = ata_scsi_slave_config, |
242 | .slave_destroy = ata_scsi_slave_destroy, | 244 | .slave_destroy = ata_scsi_slave_destroy, |
243 | .bios_param = ata_std_bios_param, | 245 | .bios_param = ata_std_bios_param, |
246 | #ifdef CONFIG_PM | ||
244 | .suspend = ata_scsi_device_suspend, | 247 | .suspend = ata_scsi_device_suspend, |
245 | .resume = ata_scsi_device_resume, | 248 | .resume = ata_scsi_device_resume, |
249 | #endif | ||
246 | }; | 250 | }; |
247 | 251 | ||
248 | static const struct ata_port_operations ahci_ops = { | 252 | static const struct ata_port_operations ahci_ops = { |
@@ -271,8 +275,10 @@ static const struct ata_port_operations ahci_ops = { | |||
271 | .error_handler = ahci_error_handler, | 275 | .error_handler = ahci_error_handler, |
272 | .post_internal_cmd = ahci_post_internal_cmd, | 276 | .post_internal_cmd = ahci_post_internal_cmd, |
273 | 277 | ||
278 | #ifdef CONFIG_PM | ||
274 | .port_suspend = ahci_port_suspend, | 279 | .port_suspend = ahci_port_suspend, |
275 | .port_resume = ahci_port_resume, | 280 | .port_resume = ahci_port_resume, |
281 | #endif | ||
276 | 282 | ||
277 | .port_start = ahci_port_start, | 283 | .port_start = ahci_port_start, |
278 | .port_stop = ahci_port_stop, | 284 | .port_stop = ahci_port_stop, |
@@ -304,8 +310,10 @@ static const struct ata_port_operations ahci_vt8251_ops = { | |||
304 | .error_handler = ahci_vt8251_error_handler, | 310 | .error_handler = ahci_vt8251_error_handler, |
305 | .post_internal_cmd = ahci_post_internal_cmd, | 311 | .post_internal_cmd = ahci_post_internal_cmd, |
306 | 312 | ||
313 | #ifdef CONFIG_PM | ||
307 | .port_suspend = ahci_port_suspend, | 314 | .port_suspend = ahci_port_suspend, |
308 | .port_resume = ahci_port_resume, | 315 | .port_resume = ahci_port_resume, |
316 | #endif | ||
309 | 317 | ||
310 | .port_start = ahci_port_start, | 318 | .port_start = ahci_port_start, |
311 | .port_stop = ahci_port_stop, | 319 | .port_stop = ahci_port_stop, |
@@ -436,8 +444,10 @@ static struct pci_driver ahci_pci_driver = { | |||
436 | .id_table = ahci_pci_tbl, | 444 | .id_table = ahci_pci_tbl, |
437 | .probe = ahci_init_one, | 445 | .probe = ahci_init_one, |
438 | .remove = ata_pci_remove_one, | 446 | .remove = ata_pci_remove_one, |
447 | #ifdef CONFIG_PM | ||
439 | .suspend = ahci_pci_device_suspend, | 448 | .suspend = ahci_pci_device_suspend, |
440 | .resume = ahci_pci_device_resume, | 449 | .resume = ahci_pci_device_resume, |
450 | #endif | ||
441 | }; | 451 | }; |
442 | 452 | ||
443 | 453 | ||
@@ -577,6 +587,7 @@ static void ahci_power_up(void __iomem *port_mmio, u32 cap) | |||
577 | writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD); | 587 | writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD); |
578 | } | 588 | } |
579 | 589 | ||
590 | #ifdef CONFIG_PM | ||
580 | static void ahci_power_down(void __iomem *port_mmio, u32 cap) | 591 | static void ahci_power_down(void __iomem *port_mmio, u32 cap) |
581 | { | 592 | { |
582 | u32 cmd, scontrol; | 593 | u32 cmd, scontrol; |
@@ -594,6 +605,7 @@ static void ahci_power_down(void __iomem *port_mmio, u32 cap) | |||
594 | cmd &= ~PORT_CMD_SPIN_UP; | 605 | cmd &= ~PORT_CMD_SPIN_UP; |
595 | writel(cmd, port_mmio + PORT_CMD); | 606 | writel(cmd, port_mmio + PORT_CMD); |
596 | } | 607 | } |
608 | #endif | ||
597 | 609 | ||
598 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, | 610 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, |
599 | dma_addr_t cmd_slot_dma, dma_addr_t rx_fis_dma) | 611 | dma_addr_t cmd_slot_dma, dma_addr_t rx_fis_dma) |
@@ -1335,6 +1347,7 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) | |||
1335 | } | 1347 | } |
1336 | } | 1348 | } |
1337 | 1349 | ||
1350 | #ifdef CONFIG_PM | ||
1338 | static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) | 1351 | static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) |
1339 | { | 1352 | { |
1340 | struct ahci_host_priv *hpriv = ap->host->private_data; | 1353 | struct ahci_host_priv *hpriv = ap->host->private_data; |
@@ -1413,6 +1426,7 @@ static int ahci_pci_device_resume(struct pci_dev *pdev) | |||
1413 | 1426 | ||
1414 | return 0; | 1427 | return 0; |
1415 | } | 1428 | } |
1429 | #endif | ||
1416 | 1430 | ||
1417 | static int ahci_port_start(struct ata_port *ap) | 1431 | static int ahci_port_start(struct ata_port *ap) |
1418 | { | 1432 | { |
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index f48b4883c930..d8e79882b880 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -119,8 +119,10 @@ static struct scsi_host_template generic_sht = { | |||
119 | .slave_configure = ata_scsi_slave_config, | 119 | .slave_configure = ata_scsi_slave_config, |
120 | .slave_destroy = ata_scsi_slave_destroy, | 120 | .slave_destroy = ata_scsi_slave_destroy, |
121 | .bios_param = ata_std_bios_param, | 121 | .bios_param = ata_std_bios_param, |
122 | #ifdef CONFIG_PM | ||
122 | .resume = ata_scsi_device_resume, | 123 | .resume = ata_scsi_device_resume, |
123 | .suspend = ata_scsi_device_suspend, | 124 | .suspend = ata_scsi_device_suspend, |
125 | #endif | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | static struct ata_port_operations generic_port_ops = { | 128 | static struct ata_port_operations generic_port_ops = { |
@@ -230,8 +232,10 @@ static struct pci_driver ata_generic_pci_driver = { | |||
230 | .id_table = ata_generic, | 232 | .id_table = ata_generic, |
231 | .probe = ata_generic_init_one, | 233 | .probe = ata_generic_init_one, |
232 | .remove = ata_pci_remove_one, | 234 | .remove = ata_pci_remove_one, |
235 | #ifdef CONFIG_PM | ||
233 | .suspend = ata_pci_device_suspend, | 236 | .suspend = ata_pci_device_suspend, |
234 | .resume = ata_pci_device_resume, | 237 | .resume = ata_pci_device_resume, |
238 | #endif | ||
235 | }; | 239 | }; |
236 | 240 | ||
237 | static int __init ata_generic_init(void) | 241 | static int __init ata_generic_init(void) |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 61572d8c78ad..dc42ba1b46f7 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -253,8 +253,10 @@ static struct pci_driver piix_pci_driver = { | |||
253 | .id_table = piix_pci_tbl, | 253 | .id_table = piix_pci_tbl, |
254 | .probe = piix_init_one, | 254 | .probe = piix_init_one, |
255 | .remove = ata_pci_remove_one, | 255 | .remove = ata_pci_remove_one, |
256 | #ifdef CONFIG_PM | ||
256 | .suspend = ata_pci_device_suspend, | 257 | .suspend = ata_pci_device_suspend, |
257 | .resume = ata_pci_device_resume, | 258 | .resume = ata_pci_device_resume, |
259 | #endif | ||
258 | }; | 260 | }; |
259 | 261 | ||
260 | static struct scsi_host_template piix_sht = { | 262 | static struct scsi_host_template piix_sht = { |
@@ -273,8 +275,10 @@ static struct scsi_host_template piix_sht = { | |||
273 | .slave_configure = ata_scsi_slave_config, | 275 | .slave_configure = ata_scsi_slave_config, |
274 | .slave_destroy = ata_scsi_slave_destroy, | 276 | .slave_destroy = ata_scsi_slave_destroy, |
275 | .bios_param = ata_std_bios_param, | 277 | .bios_param = ata_std_bios_param, |
278 | #ifdef CONFIG_PM | ||
276 | .resume = ata_scsi_device_resume, | 279 | .resume = ata_scsi_device_resume, |
277 | .suspend = ata_scsi_device_suspend, | 280 | .suspend = ata_scsi_device_suspend, |
281 | #endif | ||
278 | }; | 282 | }; |
279 | 283 | ||
280 | static const struct ata_port_operations piix_pata_ops = { | 284 | static const struct ata_port_operations piix_pata_ops = { |
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index a90ed00c07e0..11ea552a58ca 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c | |||
@@ -345,8 +345,10 @@ static struct scsi_host_template ali_sht = { | |||
345 | .slave_configure = ata_scsi_slave_config, | 345 | .slave_configure = ata_scsi_slave_config, |
346 | .slave_destroy = ata_scsi_slave_destroy, | 346 | .slave_destroy = ata_scsi_slave_destroy, |
347 | .bios_param = ata_std_bios_param, | 347 | .bios_param = ata_std_bios_param, |
348 | #ifdef CONFIG_PM | ||
348 | .resume = ata_scsi_device_resume, | 349 | .resume = ata_scsi_device_resume, |
349 | .suspend = ata_scsi_device_suspend, | 350 | .suspend = ata_scsi_device_suspend, |
351 | #endif | ||
350 | }; | 352 | }; |
351 | 353 | ||
352 | /* | 354 | /* |
@@ -667,11 +669,13 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
667 | return ata_pci_init_one(pdev, port_info, 2); | 669 | return ata_pci_init_one(pdev, port_info, 2); |
668 | } | 670 | } |
669 | 671 | ||
672 | #ifdef CONFIG_PM | ||
670 | static int ali_reinit_one(struct pci_dev *pdev) | 673 | static int ali_reinit_one(struct pci_dev *pdev) |
671 | { | 674 | { |
672 | ali_init_chipset(pdev); | 675 | ali_init_chipset(pdev); |
673 | return ata_pci_device_resume(pdev); | 676 | return ata_pci_device_resume(pdev); |
674 | } | 677 | } |
678 | #endif | ||
675 | 679 | ||
676 | static const struct pci_device_id ali[] = { | 680 | static const struct pci_device_id ali[] = { |
677 | { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), }, | 681 | { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), }, |
@@ -685,8 +689,10 @@ static struct pci_driver ali_pci_driver = { | |||
685 | .id_table = ali, | 689 | .id_table = ali, |
686 | .probe = ali_init_one, | 690 | .probe = ali_init_one, |
687 | .remove = ata_pci_remove_one, | 691 | .remove = ata_pci_remove_one, |
692 | #ifdef CONFIG_PM | ||
688 | .suspend = ata_pci_device_suspend, | 693 | .suspend = ata_pci_device_suspend, |
689 | .resume = ali_reinit_one, | 694 | .resume = ali_reinit_one, |
695 | #endif | ||
690 | }; | 696 | }; |
691 | 697 | ||
692 | static int __init ali_init(void) | 698 | static int __init ali_init(void) |
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 3c760d0f4717..18381762908b 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c | |||
@@ -334,8 +334,10 @@ static struct scsi_host_template amd_sht = { | |||
334 | .slave_configure = ata_scsi_slave_config, | 334 | .slave_configure = ata_scsi_slave_config, |
335 | .slave_destroy = ata_scsi_slave_destroy, | 335 | .slave_destroy = ata_scsi_slave_destroy, |
336 | .bios_param = ata_std_bios_param, | 336 | .bios_param = ata_std_bios_param, |
337 | #ifdef CONFIG_PM | ||
337 | .resume = ata_scsi_device_resume, | 338 | .resume = ata_scsi_device_resume, |
338 | .suspend = ata_scsi_device_suspend, | 339 | .suspend = ata_scsi_device_suspend, |
340 | #endif | ||
339 | }; | 341 | }; |
340 | 342 | ||
341 | static struct ata_port_operations amd33_port_ops = { | 343 | static struct ata_port_operations amd33_port_ops = { |
@@ -663,6 +665,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
663 | return ata_pci_init_one(pdev, port_info, 2); | 665 | return ata_pci_init_one(pdev, port_info, 2); |
664 | } | 666 | } |
665 | 667 | ||
668 | #ifdef CONFIG_PM | ||
666 | static int amd_reinit_one(struct pci_dev *pdev) | 669 | static int amd_reinit_one(struct pci_dev *pdev) |
667 | { | 670 | { |
668 | if (pdev->vendor == PCI_VENDOR_ID_AMD) { | 671 | if (pdev->vendor == PCI_VENDOR_ID_AMD) { |
@@ -679,6 +682,7 @@ static int amd_reinit_one(struct pci_dev *pdev) | |||
679 | } | 682 | } |
680 | return ata_pci_device_resume(pdev); | 683 | return ata_pci_device_resume(pdev); |
681 | } | 684 | } |
685 | #endif | ||
682 | 686 | ||
683 | static const struct pci_device_id amd[] = { | 687 | static const struct pci_device_id amd[] = { |
684 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, | 688 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, |
@@ -708,8 +712,10 @@ static struct pci_driver amd_pci_driver = { | |||
708 | .id_table = amd, | 712 | .id_table = amd, |
709 | .probe = amd_init_one, | 713 | .probe = amd_init_one, |
710 | .remove = ata_pci_remove_one, | 714 | .remove = ata_pci_remove_one, |
715 | #ifdef CONFIG_PM | ||
711 | .suspend = ata_pci_device_suspend, | 716 | .suspend = ata_pci_device_suspend, |
712 | .resume = amd_reinit_one, | 717 | .resume = amd_reinit_one, |
718 | #endif | ||
713 | }; | 719 | }; |
714 | 720 | ||
715 | static int __init amd_init(void) | 721 | static int __init amd_init(void) |
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index c3eb40c91c80..51d9923be02e 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c | |||
@@ -224,8 +224,10 @@ static struct scsi_host_template atiixp_sht = { | |||
224 | .slave_configure = ata_scsi_slave_config, | 224 | .slave_configure = ata_scsi_slave_config, |
225 | .slave_destroy = ata_scsi_slave_destroy, | 225 | .slave_destroy = ata_scsi_slave_destroy, |
226 | .bios_param = ata_std_bios_param, | 226 | .bios_param = ata_std_bios_param, |
227 | #ifdef CONFIG_PM | ||
227 | .resume = ata_scsi_device_resume, | 228 | .resume = ata_scsi_device_resume, |
228 | .suspend = ata_scsi_device_suspend, | 229 | .suspend = ata_scsi_device_suspend, |
230 | #endif | ||
229 | }; | 231 | }; |
230 | 232 | ||
231 | static struct ata_port_operations atiixp_port_ops = { | 233 | static struct ata_port_operations atiixp_port_ops = { |
@@ -290,8 +292,10 @@ static struct pci_driver atiixp_pci_driver = { | |||
290 | .id_table = atiixp, | 292 | .id_table = atiixp, |
291 | .probe = atiixp_init_one, | 293 | .probe = atiixp_init_one, |
292 | .remove = ata_pci_remove_one, | 294 | .remove = ata_pci_remove_one, |
295 | #ifdef CONFIG_PM | ||
293 | .resume = ata_pci_device_resume, | 296 | .resume = ata_pci_device_resume, |
294 | .suspend = ata_pci_device_suspend, | 297 | .suspend = ata_pci_device_suspend, |
298 | #endif | ||
295 | }; | 299 | }; |
296 | 300 | ||
297 | static int __init atiixp_init(void) | 301 | static int __init atiixp_init(void) |
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index adc21ce5b3b9..5b13bdd1edc0 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
@@ -285,8 +285,10 @@ static struct scsi_host_template cmd64x_sht = { | |||
285 | .slave_configure = ata_scsi_slave_config, | 285 | .slave_configure = ata_scsi_slave_config, |
286 | .slave_destroy = ata_scsi_slave_destroy, | 286 | .slave_destroy = ata_scsi_slave_destroy, |
287 | .bios_param = ata_std_bios_param, | 287 | .bios_param = ata_std_bios_param, |
288 | #ifdef CONFIG_PM | ||
288 | .resume = ata_scsi_device_resume, | 289 | .resume = ata_scsi_device_resume, |
289 | .suspend = ata_scsi_device_suspend, | 290 | .suspend = ata_scsi_device_suspend, |
291 | #endif | ||
290 | }; | 292 | }; |
291 | 293 | ||
292 | static struct ata_port_operations cmd64x_port_ops = { | 294 | static struct ata_port_operations cmd64x_port_ops = { |
@@ -479,6 +481,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
479 | return ata_pci_init_one(pdev, port_info, 2); | 481 | return ata_pci_init_one(pdev, port_info, 2); |
480 | } | 482 | } |
481 | 483 | ||
484 | #ifdef CONFIG_PM | ||
482 | static int cmd64x_reinit_one(struct pci_dev *pdev) | 485 | static int cmd64x_reinit_one(struct pci_dev *pdev) |
483 | { | 486 | { |
484 | u8 mrdmode; | 487 | u8 mrdmode; |
@@ -492,6 +495,7 @@ static int cmd64x_reinit_one(struct pci_dev *pdev) | |||
492 | #endif | 495 | #endif |
493 | return ata_pci_device_resume(pdev); | 496 | return ata_pci_device_resume(pdev); |
494 | } | 497 | } |
498 | #endif | ||
495 | 499 | ||
496 | static const struct pci_device_id cmd64x[] = { | 500 | static const struct pci_device_id cmd64x[] = { |
497 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_643), 0 }, | 501 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_643), 0 }, |
@@ -507,8 +511,10 @@ static struct pci_driver cmd64x_pci_driver = { | |||
507 | .id_table = cmd64x, | 511 | .id_table = cmd64x, |
508 | .probe = cmd64x_init_one, | 512 | .probe = cmd64x_init_one, |
509 | .remove = ata_pci_remove_one, | 513 | .remove = ata_pci_remove_one, |
514 | #ifdef CONFIG_PM | ||
510 | .suspend = ata_pci_device_suspend, | 515 | .suspend = ata_pci_device_suspend, |
511 | .resume = cmd64x_reinit_one, | 516 | .resume = cmd64x_reinit_one, |
517 | #endif | ||
512 | }; | 518 | }; |
513 | 519 | ||
514 | static int __init cmd64x_init(void) | 520 | static int __init cmd64x_init(void) |
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 8ff2d58c599e..7ef834250a43 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c | |||
@@ -167,8 +167,10 @@ static struct scsi_host_template cs5520_sht = { | |||
167 | .slave_configure = ata_scsi_slave_config, | 167 | .slave_configure = ata_scsi_slave_config, |
168 | .slave_destroy = ata_scsi_slave_destroy, | 168 | .slave_destroy = ata_scsi_slave_destroy, |
169 | .bios_param = ata_std_bios_param, | 169 | .bios_param = ata_std_bios_param, |
170 | #ifdef CONFIG_PM | ||
170 | .resume = ata_scsi_device_resume, | 171 | .resume = ata_scsi_device_resume, |
171 | .suspend = ata_scsi_device_suspend, | 172 | .suspend = ata_scsi_device_suspend, |
173 | #endif | ||
172 | }; | 174 | }; |
173 | 175 | ||
174 | static struct ata_port_operations cs5520_port_ops = { | 176 | static struct ata_port_operations cs5520_port_ops = { |
@@ -308,6 +310,7 @@ static void __devexit cs5520_remove_one(struct pci_dev *pdev) | |||
308 | ata_host_detach(host); | 310 | ata_host_detach(host); |
309 | } | 311 | } |
310 | 312 | ||
313 | #ifdef CONFIG_PM | ||
311 | /** | 314 | /** |
312 | * cs5520_reinit_one - device resume | 315 | * cs5520_reinit_one - device resume |
313 | * @pdev: PCI device | 316 | * @pdev: PCI device |
@@ -347,6 +350,7 @@ static int cs5520_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
347 | pci_save_state(pdev); | 350 | pci_save_state(pdev); |
348 | return 0; | 351 | return 0; |
349 | } | 352 | } |
353 | #endif /* CONFIG_PM */ | ||
350 | 354 | ||
351 | /* For now keep DMA off. We can set it for all but A rev CS5510 once the | 355 | /* For now keep DMA off. We can set it for all but A rev CS5510 once the |
352 | core ATA code can handle it */ | 356 | core ATA code can handle it */ |
@@ -363,8 +367,10 @@ static struct pci_driver cs5520_pci_driver = { | |||
363 | .id_table = pata_cs5520, | 367 | .id_table = pata_cs5520, |
364 | .probe = cs5520_init_one, | 368 | .probe = cs5520_init_one, |
365 | .remove = cs5520_remove_one, | 369 | .remove = cs5520_remove_one, |
370 | #ifdef CONFIG_PM | ||
366 | .suspend = cs5520_pci_device_suspend, | 371 | .suspend = cs5520_pci_device_suspend, |
367 | .resume = cs5520_reinit_one, | 372 | .resume = cs5520_reinit_one, |
373 | #endif | ||
368 | }; | 374 | }; |
369 | 375 | ||
370 | static int __init cs5520_init(void) | 376 | static int __init cs5520_init(void) |
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c index 78c7cdfff69d..db63e80e608b 100644 --- a/drivers/ata/pata_cs5530.c +++ b/drivers/ata/pata_cs5530.c | |||
@@ -188,8 +188,10 @@ static struct scsi_host_template cs5530_sht = { | |||
188 | .slave_configure = ata_scsi_slave_config, | 188 | .slave_configure = ata_scsi_slave_config, |
189 | .slave_destroy = ata_scsi_slave_destroy, | 189 | .slave_destroy = ata_scsi_slave_destroy, |
190 | .bios_param = ata_std_bios_param, | 190 | .bios_param = ata_std_bios_param, |
191 | #ifdef CONFIG_PM | ||
191 | .resume = ata_scsi_device_resume, | 192 | .resume = ata_scsi_device_resume, |
192 | .suspend = ata_scsi_device_suspend, | 193 | .suspend = ata_scsi_device_suspend, |
194 | #endif | ||
193 | }; | 195 | }; |
194 | 196 | ||
195 | static struct ata_port_operations cs5530_port_ops = { | 197 | static struct ata_port_operations cs5530_port_ops = { |
@@ -376,6 +378,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
376 | return ata_pci_init_one(pdev, port_info, 2); | 378 | return ata_pci_init_one(pdev, port_info, 2); |
377 | } | 379 | } |
378 | 380 | ||
381 | #ifdef CONFIG_PM | ||
379 | static int cs5530_reinit_one(struct pci_dev *pdev) | 382 | static int cs5530_reinit_one(struct pci_dev *pdev) |
380 | { | 383 | { |
381 | /* If we fail on resume we are doomed */ | 384 | /* If we fail on resume we are doomed */ |
@@ -383,6 +386,7 @@ static int cs5530_reinit_one(struct pci_dev *pdev) | |||
383 | BUG(); | 386 | BUG(); |
384 | return ata_pci_device_resume(pdev); | 387 | return ata_pci_device_resume(pdev); |
385 | } | 388 | } |
389 | #endif /* CONFIG_PM */ | ||
386 | 390 | ||
387 | static const struct pci_device_id cs5530[] = { | 391 | static const struct pci_device_id cs5530[] = { |
388 | { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), }, | 392 | { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), }, |
@@ -395,8 +399,10 @@ static struct pci_driver cs5530_pci_driver = { | |||
395 | .id_table = cs5530, | 399 | .id_table = cs5530, |
396 | .probe = cs5530_init_one, | 400 | .probe = cs5530_init_one, |
397 | .remove = ata_pci_remove_one, | 401 | .remove = ata_pci_remove_one, |
402 | #ifdef CONFIG_PM | ||
398 | .suspend = ata_pci_device_suspend, | 403 | .suspend = ata_pci_device_suspend, |
399 | .resume = cs5530_reinit_one, | 404 | .resume = cs5530_reinit_one, |
405 | #endif | ||
400 | }; | 406 | }; |
401 | 407 | ||
402 | static int __init cs5530_init(void) | 408 | static int __init cs5530_init(void) |
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c index 17bc693cc514..1572e5c9031a 100644 --- a/drivers/ata/pata_cs5535.c +++ b/drivers/ata/pata_cs5535.c | |||
@@ -185,8 +185,10 @@ static struct scsi_host_template cs5535_sht = { | |||
185 | .slave_configure = ata_scsi_slave_config, | 185 | .slave_configure = ata_scsi_slave_config, |
186 | .slave_destroy = ata_scsi_slave_destroy, | 186 | .slave_destroy = ata_scsi_slave_destroy, |
187 | .bios_param = ata_std_bios_param, | 187 | .bios_param = ata_std_bios_param, |
188 | #ifdef CONFIG_PM | ||
188 | .resume = ata_scsi_device_resume, | 189 | .resume = ata_scsi_device_resume, |
189 | .suspend = ata_scsi_device_suspend, | 190 | .suspend = ata_scsi_device_suspend, |
191 | #endif | ||
190 | }; | 192 | }; |
191 | 193 | ||
192 | static struct ata_port_operations cs5535_port_ops = { | 194 | static struct ata_port_operations cs5535_port_ops = { |
@@ -270,8 +272,10 @@ static struct pci_driver cs5535_pci_driver = { | |||
270 | .id_table = cs5535, | 272 | .id_table = cs5535, |
271 | .probe = cs5535_init_one, | 273 | .probe = cs5535_init_one, |
272 | .remove = ata_pci_remove_one, | 274 | .remove = ata_pci_remove_one, |
275 | #ifdef CONFIG_PM | ||
273 | .suspend = ata_pci_device_suspend, | 276 | .suspend = ata_pci_device_suspend, |
274 | .resume = ata_pci_device_resume, | 277 | .resume = ata_pci_device_resume, |
278 | #endif | ||
275 | }; | 279 | }; |
276 | 280 | ||
277 | static int __init cs5535_init(void) | 281 | static int __init cs5535_init(void) |
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c index 63f48f08763d..f69dde5f7066 100644 --- a/drivers/ata/pata_cypress.c +++ b/drivers/ata/pata_cypress.c | |||
@@ -136,8 +136,10 @@ static struct scsi_host_template cy82c693_sht = { | |||
136 | .slave_configure = ata_scsi_slave_config, | 136 | .slave_configure = ata_scsi_slave_config, |
137 | .slave_destroy = ata_scsi_slave_destroy, | 137 | .slave_destroy = ata_scsi_slave_destroy, |
138 | .bios_param = ata_std_bios_param, | 138 | .bios_param = ata_std_bios_param, |
139 | #ifdef CONFIG_PM | ||
139 | .resume = ata_scsi_device_resume, | 140 | .resume = ata_scsi_device_resume, |
140 | .suspend = ata_scsi_device_suspend, | 141 | .suspend = ata_scsi_device_suspend, |
142 | #endif | ||
141 | }; | 143 | }; |
142 | 144 | ||
143 | static struct ata_port_operations cy82c693_port_ops = { | 145 | static struct ata_port_operations cy82c693_port_ops = { |
@@ -206,8 +208,10 @@ static struct pci_driver cy82c693_pci_driver = { | |||
206 | .id_table = cy82c693, | 208 | .id_table = cy82c693, |
207 | .probe = cy82c693_init_one, | 209 | .probe = cy82c693_init_one, |
208 | .remove = ata_pci_remove_one, | 210 | .remove = ata_pci_remove_one, |
211 | #ifdef CONFIG_PM | ||
209 | .suspend = ata_pci_device_suspend, | 212 | .suspend = ata_pci_device_suspend, |
210 | .resume = ata_pci_device_resume, | 213 | .resume = ata_pci_device_resume, |
214 | #endif | ||
211 | }; | 215 | }; |
212 | 216 | ||
213 | static int __init cy82c693_init(void) | 217 | static int __init cy82c693_init(void) |
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c index c19b6a8a7dc6..dac7a6554f6c 100644 --- a/drivers/ata/pata_efar.c +++ b/drivers/ata/pata_efar.c | |||
@@ -234,8 +234,10 @@ static struct scsi_host_template efar_sht = { | |||
234 | .slave_configure = ata_scsi_slave_config, | 234 | .slave_configure = ata_scsi_slave_config, |
235 | .slave_destroy = ata_scsi_slave_destroy, | 235 | .slave_destroy = ata_scsi_slave_destroy, |
236 | .bios_param = ata_std_bios_param, | 236 | .bios_param = ata_std_bios_param, |
237 | #ifdef CONFIG_PM | ||
237 | .resume = ata_scsi_device_resume, | 238 | .resume = ata_scsi_device_resume, |
238 | .suspend = ata_scsi_device_suspend, | 239 | .suspend = ata_scsi_device_suspend, |
240 | #endif | ||
239 | }; | 241 | }; |
240 | 242 | ||
241 | static const struct ata_port_operations efar_ops = { | 243 | static const struct ata_port_operations efar_ops = { |
@@ -317,8 +319,10 @@ static struct pci_driver efar_pci_driver = { | |||
317 | .id_table = efar_pci_tbl, | 319 | .id_table = efar_pci_tbl, |
318 | .probe = efar_init_one, | 320 | .probe = efar_init_one, |
319 | .remove = ata_pci_remove_one, | 321 | .remove = ata_pci_remove_one, |
322 | #ifdef CONFIG_PM | ||
320 | .suspend = ata_pci_device_suspend, | 323 | .suspend = ata_pci_device_suspend, |
321 | .resume = ata_pci_device_resume, | 324 | .resume = ata_pci_device_resume, |
325 | #endif | ||
322 | }; | 326 | }; |
323 | 327 | ||
324 | static int __init efar_init(void) | 328 | static int __init efar_init(void) |
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index e7d33c628a61..baf35f876030 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
@@ -328,8 +328,10 @@ static struct scsi_host_template hpt36x_sht = { | |||
328 | .slave_configure = ata_scsi_slave_config, | 328 | .slave_configure = ata_scsi_slave_config, |
329 | .slave_destroy = ata_scsi_slave_destroy, | 329 | .slave_destroy = ata_scsi_slave_destroy, |
330 | .bios_param = ata_std_bios_param, | 330 | .bios_param = ata_std_bios_param, |
331 | #ifdef CONFIG_PM | ||
331 | .resume = ata_scsi_device_resume, | 332 | .resume = ata_scsi_device_resume, |
332 | .suspend = ata_scsi_device_suspend, | 333 | .suspend = ata_scsi_device_suspend, |
334 | #endif | ||
333 | }; | 335 | }; |
334 | 336 | ||
335 | /* | 337 | /* |
@@ -457,12 +459,13 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
457 | return ata_pci_init_one(dev, port_info, 2); | 459 | return ata_pci_init_one(dev, port_info, 2); |
458 | } | 460 | } |
459 | 461 | ||
462 | #ifdef CONFIG_PM | ||
460 | static int hpt36x_reinit_one(struct pci_dev *dev) | 463 | static int hpt36x_reinit_one(struct pci_dev *dev) |
461 | { | 464 | { |
462 | hpt36x_init_chipset(dev); | 465 | hpt36x_init_chipset(dev); |
463 | return ata_pci_device_resume(dev); | 466 | return ata_pci_device_resume(dev); |
464 | } | 467 | } |
465 | 468 | #endif | |
466 | 469 | ||
467 | static const struct pci_device_id hpt36x[] = { | 470 | static const struct pci_device_id hpt36x[] = { |
468 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), }, | 471 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), }, |
@@ -474,8 +477,10 @@ static struct pci_driver hpt36x_pci_driver = { | |||
474 | .id_table = hpt36x, | 477 | .id_table = hpt36x, |
475 | .probe = hpt36x_init_one, | 478 | .probe = hpt36x_init_one, |
476 | .remove = ata_pci_remove_one, | 479 | .remove = ata_pci_remove_one, |
480 | #ifdef CONFIG_PM | ||
477 | .suspend = ata_pci_device_suspend, | 481 | .suspend = ata_pci_device_suspend, |
478 | .resume = hpt36x_reinit_one, | 482 | .resume = hpt36x_reinit_one, |
483 | #endif | ||
479 | }; | 484 | }; |
480 | 485 | ||
481 | static int __init hpt36x_init(void) | 486 | static int __init hpt36x_init(void) |
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c index 483ce7c12c9a..813485c8526c 100644 --- a/drivers/ata/pata_hpt3x3.c +++ b/drivers/ata/pata_hpt3x3.c | |||
@@ -119,8 +119,10 @@ static struct scsi_host_template hpt3x3_sht = { | |||
119 | .slave_configure = ata_scsi_slave_config, | 119 | .slave_configure = ata_scsi_slave_config, |
120 | .slave_destroy = ata_scsi_slave_destroy, | 120 | .slave_destroy = ata_scsi_slave_destroy, |
121 | .bios_param = ata_std_bios_param, | 121 | .bios_param = ata_std_bios_param, |
122 | #ifdef CONFIG_PM | ||
122 | .resume = ata_scsi_device_resume, | 123 | .resume = ata_scsi_device_resume, |
123 | .suspend = ata_scsi_device_suspend, | 124 | .suspend = ata_scsi_device_suspend, |
125 | #endif | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | static struct ata_port_operations hpt3x3_port_ops = { | 128 | static struct ata_port_operations hpt3x3_port_ops = { |
@@ -206,11 +208,13 @@ static int hpt3x3_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
206 | return ata_pci_init_one(dev, port_info, 2); | 208 | return ata_pci_init_one(dev, port_info, 2); |
207 | } | 209 | } |
208 | 210 | ||
211 | #ifdef CONFIG_PM | ||
209 | static int hpt3x3_reinit_one(struct pci_dev *dev) | 212 | static int hpt3x3_reinit_one(struct pci_dev *dev) |
210 | { | 213 | { |
211 | hpt3x3_init_chipset(dev); | 214 | hpt3x3_init_chipset(dev); |
212 | return ata_pci_device_resume(dev); | 215 | return ata_pci_device_resume(dev); |
213 | } | 216 | } |
217 | #endif | ||
214 | 218 | ||
215 | static const struct pci_device_id hpt3x3[] = { | 219 | static const struct pci_device_id hpt3x3[] = { |
216 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT343), }, | 220 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT343), }, |
@@ -223,8 +227,10 @@ static struct pci_driver hpt3x3_pci_driver = { | |||
223 | .id_table = hpt3x3, | 227 | .id_table = hpt3x3, |
224 | .probe = hpt3x3_init_one, | 228 | .probe = hpt3x3_init_one, |
225 | .remove = ata_pci_remove_one, | 229 | .remove = ata_pci_remove_one, |
230 | #ifdef CONFIG_PM | ||
226 | .suspend = ata_pci_device_suspend, | 231 | .suspend = ata_pci_device_suspend, |
227 | .resume = hpt3x3_reinit_one, | 232 | .resume = hpt3x3_reinit_one, |
233 | #endif | ||
228 | }; | 234 | }; |
229 | 235 | ||
230 | static int __init hpt3x3_init(void) | 236 | static int __init hpt3x3_init(void) |
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c index 7eac869dfcd3..ea734701555e 100644 --- a/drivers/ata/pata_it8213.c +++ b/drivers/ata/pata_it8213.c | |||
@@ -246,8 +246,10 @@ static struct scsi_host_template it8213_sht = { | |||
246 | .dma_boundary = ATA_DMA_BOUNDARY, | 246 | .dma_boundary = ATA_DMA_BOUNDARY, |
247 | .slave_configure = ata_scsi_slave_config, | 247 | .slave_configure = ata_scsi_slave_config, |
248 | .bios_param = ata_std_bios_param, | 248 | .bios_param = ata_std_bios_param, |
249 | #ifdef CONFIG_PM | ||
249 | .resume = ata_scsi_device_resume, | 250 | .resume = ata_scsi_device_resume, |
250 | .suspend = ata_scsi_device_suspend, | 251 | .suspend = ata_scsi_device_suspend, |
252 | #endif | ||
251 | }; | 253 | }; |
252 | 254 | ||
253 | static const struct ata_port_operations it8213_ops = { | 255 | static const struct ata_port_operations it8213_ops = { |
@@ -330,8 +332,10 @@ static struct pci_driver it8213_pci_driver = { | |||
330 | .id_table = it8213_pci_tbl, | 332 | .id_table = it8213_pci_tbl, |
331 | .probe = it8213_init_one, | 333 | .probe = it8213_init_one, |
332 | .remove = ata_pci_remove_one, | 334 | .remove = ata_pci_remove_one, |
335 | #ifdef CONFIG_PM | ||
333 | .suspend = ata_pci_device_suspend, | 336 | .suspend = ata_pci_device_suspend, |
334 | .resume = ata_pci_device_resume, | 337 | .resume = ata_pci_device_resume, |
338 | #endif | ||
335 | }; | 339 | }; |
336 | 340 | ||
337 | static int __init it8213_init(void) | 341 | static int __init it8213_init(void) |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 903137a6da5e..35ecb2ba067b 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -646,8 +646,10 @@ static struct scsi_host_template it821x_sht = { | |||
646 | .slave_configure = ata_scsi_slave_config, | 646 | .slave_configure = ata_scsi_slave_config, |
647 | .slave_destroy = ata_scsi_slave_destroy, | 647 | .slave_destroy = ata_scsi_slave_destroy, |
648 | .bios_param = ata_std_bios_param, | 648 | .bios_param = ata_std_bios_param, |
649 | #ifdef CONFIG_PM | ||
649 | .resume = ata_scsi_device_resume, | 650 | .resume = ata_scsi_device_resume, |
650 | .suspend = ata_scsi_device_suspend, | 651 | .suspend = ata_scsi_device_suspend, |
652 | #endif | ||
651 | }; | 653 | }; |
652 | 654 | ||
653 | static struct ata_port_operations it821x_smart_port_ops = { | 655 | static struct ata_port_operations it821x_smart_port_ops = { |
@@ -780,6 +782,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
780 | return ata_pci_init_one(pdev, port_info, 2); | 782 | return ata_pci_init_one(pdev, port_info, 2); |
781 | } | 783 | } |
782 | 784 | ||
785 | #ifdef CONFIG_PM | ||
783 | static int it821x_reinit_one(struct pci_dev *pdev) | 786 | static int it821x_reinit_one(struct pci_dev *pdev) |
784 | { | 787 | { |
785 | /* Resume - turn raid back off if need be */ | 788 | /* Resume - turn raid back off if need be */ |
@@ -787,6 +790,7 @@ static int it821x_reinit_one(struct pci_dev *pdev) | |||
787 | it821x_disable_raid(pdev); | 790 | it821x_disable_raid(pdev); |
788 | return ata_pci_device_resume(pdev); | 791 | return ata_pci_device_resume(pdev); |
789 | } | 792 | } |
793 | #endif | ||
790 | 794 | ||
791 | static const struct pci_device_id it821x[] = { | 795 | static const struct pci_device_id it821x[] = { |
792 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), }, | 796 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), }, |
@@ -800,8 +804,10 @@ static struct pci_driver it821x_pci_driver = { | |||
800 | .id_table = it821x, | 804 | .id_table = it821x, |
801 | .probe = it821x_init_one, | 805 | .probe = it821x_init_one, |
802 | .remove = ata_pci_remove_one, | 806 | .remove = ata_pci_remove_one, |
807 | #ifdef CONFIG_PM | ||
803 | .suspend = ata_pci_device_suspend, | 808 | .suspend = ata_pci_device_suspend, |
804 | .resume = it821x_reinit_one, | 809 | .resume = it821x_reinit_one, |
810 | #endif | ||
805 | }; | 811 | }; |
806 | 812 | ||
807 | static int __init it821x_init(void) | 813 | static int __init it821x_init(void) |
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c index 7ede3232e928..033319e8b6cf 100644 --- a/drivers/ata/pata_jmicron.c +++ b/drivers/ata/pata_jmicron.c | |||
@@ -229,8 +229,10 @@ static struct pci_driver jmicron_pci_driver = { | |||
229 | .id_table = jmicron_pci_tbl, | 229 | .id_table = jmicron_pci_tbl, |
230 | .probe = jmicron_init_one, | 230 | .probe = jmicron_init_one, |
231 | .remove = ata_pci_remove_one, | 231 | .remove = ata_pci_remove_one, |
232 | #ifdef CONFIG_PM | ||
232 | .suspend = ata_pci_device_suspend, | 233 | .suspend = ata_pci_device_suspend, |
233 | .resume = ata_pci_device_resume, | 234 | .resume = ata_pci_device_resume, |
235 | #endif | ||
234 | }; | 236 | }; |
235 | 237 | ||
236 | static int __init jmicron_init(void) | 238 | static int __init jmicron_init(void) |
@@ -242,6 +244,7 @@ static void __exit jmicron_exit(void) | |||
242 | { | 244 | { |
243 | pci_unregister_driver(&jmicron_pci_driver); | 245 | pci_unregister_driver(&jmicron_pci_driver); |
244 | } | 246 | } |
247 | #endif | ||
245 | 248 | ||
246 | module_init(jmicron_init); | 249 | module_init(jmicron_init); |
247 | module_exit(jmicron_exit); | 250 | module_exit(jmicron_exit); |
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c index 13a70ac6f1dc..6dd7c4ef3e66 100644 --- a/drivers/ata/pata_marvell.c +++ b/drivers/ata/pata_marvell.c | |||
@@ -103,8 +103,10 @@ static struct scsi_host_template marvell_sht = { | |||
103 | .slave_destroy = ata_scsi_slave_destroy, | 103 | .slave_destroy = ata_scsi_slave_destroy, |
104 | /* Use standard CHS mapping rules */ | 104 | /* Use standard CHS mapping rules */ |
105 | .bios_param = ata_std_bios_param, | 105 | .bios_param = ata_std_bios_param, |
106 | #ifdef CONFIG_PM | ||
106 | .resume = ata_scsi_device_resume, | 107 | .resume = ata_scsi_device_resume, |
107 | .suspend = ata_scsi_device_suspend, | 108 | .suspend = ata_scsi_device_suspend, |
109 | #endif | ||
108 | }; | 110 | }; |
109 | 111 | ||
110 | static const struct ata_port_operations marvell_ops = { | 112 | static const struct ata_port_operations marvell_ops = { |
@@ -199,8 +201,10 @@ static struct pci_driver marvell_pci_driver = { | |||
199 | .id_table = marvell_pci_tbl, | 201 | .id_table = marvell_pci_tbl, |
200 | .probe = marvell_init_one, | 202 | .probe = marvell_init_one, |
201 | .remove = ata_pci_remove_one, | 203 | .remove = ata_pci_remove_one, |
204 | #ifdef CONFIG_PM | ||
202 | .suspend = ata_pci_device_suspend, | 205 | .suspend = ata_pci_device_suspend, |
203 | .resume = ata_pci_device_resume, | 206 | .resume = ata_pci_device_resume, |
207 | #endif | ||
204 | }; | 208 | }; |
205 | 209 | ||
206 | static int __init marvell_init(void) | 210 | static int __init marvell_init(void) |
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c index f2e7115f7ab9..4abe45ac19a2 100644 --- a/drivers/ata/pata_mpiix.c +++ b/drivers/ata/pata_mpiix.c | |||
@@ -165,8 +165,10 @@ static struct scsi_host_template mpiix_sht = { | |||
165 | .slave_configure = ata_scsi_slave_config, | 165 | .slave_configure = ata_scsi_slave_config, |
166 | .slave_destroy = ata_scsi_slave_destroy, | 166 | .slave_destroy = ata_scsi_slave_destroy, |
167 | .bios_param = ata_std_bios_param, | 167 | .bios_param = ata_std_bios_param, |
168 | #ifdef CONFIG_PM | ||
168 | .resume = ata_scsi_device_resume, | 169 | .resume = ata_scsi_device_resume, |
169 | .suspend = ata_scsi_device_suspend, | 170 | .suspend = ata_scsi_device_suspend, |
171 | #endif | ||
170 | }; | 172 | }; |
171 | 173 | ||
172 | static struct ata_port_operations mpiix_port_ops = { | 174 | static struct ata_port_operations mpiix_port_ops = { |
@@ -270,8 +272,10 @@ static struct pci_driver mpiix_pci_driver = { | |||
270 | .id_table = mpiix, | 272 | .id_table = mpiix, |
271 | .probe = mpiix_init_one, | 273 | .probe = mpiix_init_one, |
272 | .remove = ata_pci_remove_one, | 274 | .remove = ata_pci_remove_one, |
275 | #ifdef CONFIG_PM | ||
273 | .suspend = ata_pci_device_suspend, | 276 | .suspend = ata_pci_device_suspend, |
274 | .resume = ata_pci_device_resume, | 277 | .resume = ata_pci_device_resume, |
278 | #endif | ||
275 | }; | 279 | }; |
276 | 280 | ||
277 | static int __init mpiix_init(void) | 281 | static int __init mpiix_init(void) |
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c index e8393e19be47..38f99b38a5ea 100644 --- a/drivers/ata/pata_netcell.c +++ b/drivers/ata/pata_netcell.c | |||
@@ -63,8 +63,10 @@ static struct scsi_host_template netcell_sht = { | |||
63 | .slave_destroy = ata_scsi_slave_destroy, | 63 | .slave_destroy = ata_scsi_slave_destroy, |
64 | /* Use standard CHS mapping rules */ | 64 | /* Use standard CHS mapping rules */ |
65 | .bios_param = ata_std_bios_param, | 65 | .bios_param = ata_std_bios_param, |
66 | #ifdef CONFIG_PM | ||
66 | .resume = ata_scsi_device_resume, | 67 | .resume = ata_scsi_device_resume, |
67 | .suspend = ata_scsi_device_suspend, | 68 | .suspend = ata_scsi_device_suspend, |
69 | #endif | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | static const struct ata_port_operations netcell_ops = { | 72 | static const struct ata_port_operations netcell_ops = { |
@@ -153,8 +155,10 @@ static struct pci_driver netcell_pci_driver = { | |||
153 | .id_table = netcell_pci_tbl, | 155 | .id_table = netcell_pci_tbl, |
154 | .probe = netcell_init_one, | 156 | .probe = netcell_init_one, |
155 | .remove = ata_pci_remove_one, | 157 | .remove = ata_pci_remove_one, |
158 | #ifdef CONFIG_PM | ||
156 | .suspend = ata_pci_device_suspend, | 159 | .suspend = ata_pci_device_suspend, |
157 | .resume = ata_pci_device_resume, | 160 | .resume = ata_pci_device_resume, |
161 | #endif | ||
158 | }; | 162 | }; |
159 | 163 | ||
160 | static int __init netcell_init(void) | 164 | static int __init netcell_init(void) |
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c index 3d1fa487c486..9944a28daa9c 100644 --- a/drivers/ata/pata_ns87410.c +++ b/drivers/ata/pata_ns87410.c | |||
@@ -157,8 +157,10 @@ static struct scsi_host_template ns87410_sht = { | |||
157 | .slave_configure = ata_scsi_slave_config, | 157 | .slave_configure = ata_scsi_slave_config, |
158 | .slave_destroy = ata_scsi_slave_destroy, | 158 | .slave_destroy = ata_scsi_slave_destroy, |
159 | .bios_param = ata_std_bios_param, | 159 | .bios_param = ata_std_bios_param, |
160 | #ifdef CONFIG_PM | ||
160 | .resume = ata_scsi_device_resume, | 161 | .resume = ata_scsi_device_resume, |
161 | .suspend = ata_scsi_device_suspend, | 162 | .suspend = ata_scsi_device_suspend, |
163 | #endif | ||
162 | }; | 164 | }; |
163 | 165 | ||
164 | static struct ata_port_operations ns87410_port_ops = { | 166 | static struct ata_port_operations ns87410_port_ops = { |
@@ -212,8 +214,10 @@ static struct pci_driver ns87410_pci_driver = { | |||
212 | .id_table = ns87410, | 214 | .id_table = ns87410, |
213 | .probe = ns87410_init_one, | 215 | .probe = ns87410_init_one, |
214 | .remove = ata_pci_remove_one, | 216 | .remove = ata_pci_remove_one, |
217 | #ifdef CONFIG_PM | ||
215 | .suspend = ata_pci_device_suspend, | 218 | .suspend = ata_pci_device_suspend, |
216 | .resume = ata_pci_device_resume, | 219 | .resume = ata_pci_device_resume, |
220 | #endif | ||
217 | }; | 221 | }; |
218 | 222 | ||
219 | static int __init ns87410_init(void) | 223 | static int __init ns87410_init(void) |
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c index 2389107a2006..da68cd19efd6 100644 --- a/drivers/ata/pata_oldpiix.c +++ b/drivers/ata/pata_oldpiix.c | |||
@@ -233,8 +233,10 @@ static struct scsi_host_template oldpiix_sht = { | |||
233 | .slave_configure = ata_scsi_slave_config, | 233 | .slave_configure = ata_scsi_slave_config, |
234 | .slave_destroy = ata_scsi_slave_destroy, | 234 | .slave_destroy = ata_scsi_slave_destroy, |
235 | .bios_param = ata_std_bios_param, | 235 | .bios_param = ata_std_bios_param, |
236 | #ifdef CONFIG_PM | ||
236 | .resume = ata_scsi_device_resume, | 237 | .resume = ata_scsi_device_resume, |
237 | .suspend = ata_scsi_device_suspend, | 238 | .suspend = ata_scsi_device_suspend, |
239 | #endif | ||
238 | }; | 240 | }; |
239 | 241 | ||
240 | static const struct ata_port_operations oldpiix_pata_ops = { | 242 | static const struct ata_port_operations oldpiix_pata_ops = { |
@@ -316,8 +318,10 @@ static struct pci_driver oldpiix_pci_driver = { | |||
316 | .id_table = oldpiix_pci_tbl, | 318 | .id_table = oldpiix_pci_tbl, |
317 | .probe = oldpiix_init_one, | 319 | .probe = oldpiix_init_one, |
318 | .remove = ata_pci_remove_one, | 320 | .remove = ata_pci_remove_one, |
321 | #ifdef CONFIG_PM | ||
319 | .suspend = ata_pci_device_suspend, | 322 | .suspend = ata_pci_device_suspend, |
320 | .resume = ata_pci_device_resume, | 323 | .resume = ata_pci_device_resume, |
324 | #endif | ||
321 | }; | 325 | }; |
322 | 326 | ||
323 | static int __init oldpiix_init(void) | 327 | static int __init oldpiix_init(void) |
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c index 1b3cd5369f03..3fd3a35c2241 100644 --- a/drivers/ata/pata_opti.c +++ b/drivers/ata/pata_opti.c | |||
@@ -179,8 +179,10 @@ static struct scsi_host_template opti_sht = { | |||
179 | .slave_configure = ata_scsi_slave_config, | 179 | .slave_configure = ata_scsi_slave_config, |
180 | .slave_destroy = ata_scsi_slave_destroy, | 180 | .slave_destroy = ata_scsi_slave_destroy, |
181 | .bios_param = ata_std_bios_param, | 181 | .bios_param = ata_std_bios_param, |
182 | #ifdef CONFIG_PM | ||
182 | .resume = ata_scsi_device_resume, | 183 | .resume = ata_scsi_device_resume, |
183 | .suspend = ata_scsi_device_suspend, | 184 | .suspend = ata_scsi_device_suspend, |
185 | #endif | ||
184 | }; | 186 | }; |
185 | 187 | ||
186 | static struct ata_port_operations opti_port_ops = { | 188 | static struct ata_port_operations opti_port_ops = { |
@@ -244,8 +246,10 @@ static struct pci_driver opti_pci_driver = { | |||
244 | .id_table = opti, | 246 | .id_table = opti, |
245 | .probe = opti_init_one, | 247 | .probe = opti_init_one, |
246 | .remove = ata_pci_remove_one, | 248 | .remove = ata_pci_remove_one, |
249 | #ifdef CONFIG_PM | ||
247 | .suspend = ata_pci_device_suspend, | 250 | .suspend = ata_pci_device_suspend, |
248 | .resume = ata_pci_device_resume, | 251 | .resume = ata_pci_device_resume, |
252 | #endif | ||
249 | }; | 253 | }; |
250 | 254 | ||
251 | static int __init opti_init(void) | 255 | static int __init opti_init(void) |
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c index b76c976e505c..9764907e8a13 100644 --- a/drivers/ata/pata_optidma.c +++ b/drivers/ata/pata_optidma.c | |||
@@ -360,8 +360,10 @@ static struct scsi_host_template optidma_sht = { | |||
360 | .slave_configure = ata_scsi_slave_config, | 360 | .slave_configure = ata_scsi_slave_config, |
361 | .slave_destroy = ata_scsi_slave_destroy, | 361 | .slave_destroy = ata_scsi_slave_destroy, |
362 | .bios_param = ata_std_bios_param, | 362 | .bios_param = ata_std_bios_param, |
363 | #ifdef CONFIG_PM | ||
363 | .resume = ata_scsi_device_resume, | 364 | .resume = ata_scsi_device_resume, |
364 | .suspend = ata_scsi_device_suspend, | 365 | .suspend = ata_scsi_device_suspend, |
366 | #endif | ||
365 | }; | 367 | }; |
366 | 368 | ||
367 | static struct ata_port_operations optidma_port_ops = { | 369 | static struct ata_port_operations optidma_port_ops = { |
@@ -524,8 +526,10 @@ static struct pci_driver optidma_pci_driver = { | |||
524 | .id_table = optidma, | 526 | .id_table = optidma, |
525 | .probe = optidma_init_one, | 527 | .probe = optidma_init_one, |
526 | .remove = ata_pci_remove_one, | 528 | .remove = ata_pci_remove_one, |
529 | #ifdef CONFIG_PM | ||
527 | .suspend = ata_pci_device_suspend, | 530 | .suspend = ata_pci_device_suspend, |
528 | .resume = ata_pci_device_resume, | 531 | .resume = ata_pci_device_resume, |
532 | #endif | ||
529 | }; | 533 | }; |
530 | 534 | ||
531 | static int __init optidma_init(void) | 535 | static int __init optidma_init(void) |
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c index 80685388c2bd..3fb417780166 100644 --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c | |||
@@ -267,8 +267,10 @@ static struct scsi_host_template pdc202xx_sht = { | |||
267 | .slave_configure = ata_scsi_slave_config, | 267 | .slave_configure = ata_scsi_slave_config, |
268 | .slave_destroy = ata_scsi_slave_destroy, | 268 | .slave_destroy = ata_scsi_slave_destroy, |
269 | .bios_param = ata_std_bios_param, | 269 | .bios_param = ata_std_bios_param, |
270 | #ifdef CONFIG_PM | ||
270 | .resume = ata_scsi_device_resume, | 271 | .resume = ata_scsi_device_resume, |
271 | .suspend = ata_scsi_device_suspend, | 272 | .suspend = ata_scsi_device_suspend, |
273 | #endif | ||
272 | }; | 274 | }; |
273 | 275 | ||
274 | static struct ata_port_operations pdc2024x_port_ops = { | 276 | static struct ata_port_operations pdc2024x_port_ops = { |
@@ -399,8 +401,10 @@ static struct pci_driver pdc202xx_pci_driver = { | |||
399 | .id_table = pdc202xx, | 401 | .id_table = pdc202xx, |
400 | .probe = pdc202xx_init_one, | 402 | .probe = pdc202xx_init_one, |
401 | .remove = ata_pci_remove_one, | 403 | .remove = ata_pci_remove_one, |
404 | #ifdef CONFIG_PM | ||
402 | .suspend = ata_pci_device_suspend, | 405 | .suspend = ata_pci_device_suspend, |
403 | .resume = ata_pci_device_resume, | 406 | .resume = ata_pci_device_resume, |
407 | #endif | ||
404 | }; | 408 | }; |
405 | 409 | ||
406 | static int __init pdc202xx_init(void) | 410 | static int __init pdc202xx_init(void) |
diff --git a/drivers/ata/pata_radisys.c b/drivers/ata/pata_radisys.c index 0d1e571ef633..9a9132c9e331 100644 --- a/drivers/ata/pata_radisys.c +++ b/drivers/ata/pata_radisys.c | |||
@@ -228,8 +228,10 @@ static struct scsi_host_template radisys_sht = { | |||
228 | .slave_configure = ata_scsi_slave_config, | 228 | .slave_configure = ata_scsi_slave_config, |
229 | .slave_destroy = ata_scsi_slave_destroy, | 229 | .slave_destroy = ata_scsi_slave_destroy, |
230 | .bios_param = ata_std_bios_param, | 230 | .bios_param = ata_std_bios_param, |
231 | #ifdef CONFIG_PM | ||
231 | .resume = ata_scsi_device_resume, | 232 | .resume = ata_scsi_device_resume, |
232 | .suspend = ata_scsi_device_suspend, | 233 | .suspend = ata_scsi_device_suspend, |
234 | #endif | ||
233 | }; | 235 | }; |
234 | 236 | ||
235 | static const struct ata_port_operations radisys_pata_ops = { | 237 | static const struct ata_port_operations radisys_pata_ops = { |
@@ -312,8 +314,10 @@ static struct pci_driver radisys_pci_driver = { | |||
312 | .id_table = radisys_pci_tbl, | 314 | .id_table = radisys_pci_tbl, |
313 | .probe = radisys_init_one, | 315 | .probe = radisys_init_one, |
314 | .remove = ata_pci_remove_one, | 316 | .remove = ata_pci_remove_one, |
317 | #ifdef CONFIG_PM | ||
315 | .suspend = ata_pci_device_suspend, | 318 | .suspend = ata_pci_device_suspend, |
316 | .resume = ata_pci_device_resume, | 319 | .resume = ata_pci_device_resume, |
320 | #endif | ||
317 | }; | 321 | }; |
318 | 322 | ||
319 | static int __init radisys_init(void) | 323 | static int __init radisys_init(void) |
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c index 60fc598f765d..f522daa2a6aa 100644 --- a/drivers/ata/pata_rz1000.c +++ b/drivers/ata/pata_rz1000.c | |||
@@ -94,8 +94,10 @@ static struct scsi_host_template rz1000_sht = { | |||
94 | .slave_configure = ata_scsi_slave_config, | 94 | .slave_configure = ata_scsi_slave_config, |
95 | .slave_destroy = ata_scsi_slave_destroy, | 95 | .slave_destroy = ata_scsi_slave_destroy, |
96 | .bios_param = ata_std_bios_param, | 96 | .bios_param = ata_std_bios_param, |
97 | #ifdef CONFIG_PM | ||
97 | .resume = ata_scsi_device_resume, | 98 | .resume = ata_scsi_device_resume, |
98 | .suspend = ata_scsi_device_suspend, | 99 | .suspend = ata_scsi_device_suspend, |
100 | #endif | ||
99 | }; | 101 | }; |
100 | 102 | ||
101 | static struct ata_port_operations rz1000_port_ops = { | 103 | static struct ata_port_operations rz1000_port_ops = { |
@@ -178,6 +180,7 @@ static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *en | |||
178 | return -ENODEV; | 180 | return -ENODEV; |
179 | } | 181 | } |
180 | 182 | ||
183 | #ifdef CONFIG_PM | ||
181 | static int rz1000_reinit_one(struct pci_dev *pdev) | 184 | static int rz1000_reinit_one(struct pci_dev *pdev) |
182 | { | 185 | { |
183 | /* If this fails on resume (which is a "cant happen" case), we | 186 | /* If this fails on resume (which is a "cant happen" case), we |
@@ -186,6 +189,7 @@ static int rz1000_reinit_one(struct pci_dev *pdev) | |||
186 | panic("rz1000 fifo"); | 189 | panic("rz1000 fifo"); |
187 | return ata_pci_device_resume(pdev); | 190 | return ata_pci_device_resume(pdev); |
188 | } | 191 | } |
192 | #endif | ||
189 | 193 | ||
190 | static const struct pci_device_id pata_rz1000[] = { | 194 | static const struct pci_device_id pata_rz1000[] = { |
191 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), }, | 195 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), }, |
@@ -199,8 +203,10 @@ static struct pci_driver rz1000_pci_driver = { | |||
199 | .id_table = pata_rz1000, | 203 | .id_table = pata_rz1000, |
200 | .probe = rz1000_init_one, | 204 | .probe = rz1000_init_one, |
201 | .remove = ata_pci_remove_one, | 205 | .remove = ata_pci_remove_one, |
206 | #ifdef CONFIG_PM | ||
202 | .suspend = ata_pci_device_suspend, | 207 | .suspend = ata_pci_device_suspend, |
203 | .resume = rz1000_reinit_one, | 208 | .resume = rz1000_reinit_one, |
209 | #endif | ||
204 | }; | 210 | }; |
205 | 211 | ||
206 | static int __init rz1000_init(void) | 212 | static int __init rz1000_init(void) |
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c index c94504b38b5e..93b3ed0f9e8a 100644 --- a/drivers/ata/pata_sc1200.c +++ b/drivers/ata/pata_sc1200.c | |||
@@ -194,8 +194,10 @@ static struct scsi_host_template sc1200_sht = { | |||
194 | .slave_configure = ata_scsi_slave_config, | 194 | .slave_configure = ata_scsi_slave_config, |
195 | .slave_destroy = ata_scsi_slave_destroy, | 195 | .slave_destroy = ata_scsi_slave_destroy, |
196 | .bios_param = ata_std_bios_param, | 196 | .bios_param = ata_std_bios_param, |
197 | #ifdef CONFIG_PM | ||
197 | .resume = ata_scsi_device_resume, | 198 | .resume = ata_scsi_device_resume, |
198 | .suspend = ata_scsi_device_suspend, | 199 | .suspend = ata_scsi_device_suspend, |
200 | #endif | ||
199 | }; | 201 | }; |
200 | 202 | ||
201 | static struct ata_port_operations sc1200_port_ops = { | 203 | static struct ata_port_operations sc1200_port_ops = { |
@@ -269,8 +271,10 @@ static struct pci_driver sc1200_pci_driver = { | |||
269 | .id_table = sc1200, | 271 | .id_table = sc1200, |
270 | .probe = sc1200_init_one, | 272 | .probe = sc1200_init_one, |
271 | .remove = ata_pci_remove_one, | 273 | .remove = ata_pci_remove_one, |
274 | #ifdef CONFIG_PM | ||
272 | .suspend = ata_pci_device_suspend, | 275 | .suspend = ata_pci_device_suspend, |
273 | .resume = ata_pci_device_resume, | 276 | .resume = ata_pci_device_resume, |
277 | #endif | ||
274 | }; | 278 | }; |
275 | 279 | ||
276 | static int __init sc1200_init(void) | 280 | static int __init sc1200_init(void) |
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c index 45866098fbf9..f3ed141fdc0e 100644 --- a/drivers/ata/pata_scc.c +++ b/drivers/ata/pata_scc.c | |||
@@ -984,8 +984,10 @@ static struct scsi_host_template scc_sht = { | |||
984 | .slave_configure = ata_scsi_slave_config, | 984 | .slave_configure = ata_scsi_slave_config, |
985 | .slave_destroy = ata_scsi_slave_destroy, | 985 | .slave_destroy = ata_scsi_slave_destroy, |
986 | .bios_param = ata_std_bios_param, | 986 | .bios_param = ata_std_bios_param, |
987 | #ifdef CONFIG_PM | ||
987 | .resume = ata_scsi_device_resume, | 988 | .resume = ata_scsi_device_resume, |
988 | .suspend = ata_scsi_device_suspend, | 989 | .suspend = ata_scsi_device_suspend, |
990 | #endif | ||
989 | }; | 991 | }; |
990 | 992 | ||
991 | static const struct ata_port_operations scc_pata_ops = { | 993 | static const struct ata_port_operations scc_pata_ops = { |
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c index dde7eb9f72bb..598eef810a74 100644 --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c | |||
@@ -319,8 +319,10 @@ static struct scsi_host_template serverworks_sht = { | |||
319 | .slave_configure = ata_scsi_slave_config, | 319 | .slave_configure = ata_scsi_slave_config, |
320 | .slave_destroy = ata_scsi_slave_destroy, | 320 | .slave_destroy = ata_scsi_slave_destroy, |
321 | .bios_param = ata_std_bios_param, | 321 | .bios_param = ata_std_bios_param, |
322 | #ifdef CONFIG_PM | ||
322 | .resume = ata_scsi_device_resume, | 323 | .resume = ata_scsi_device_resume, |
323 | .suspend = ata_scsi_device_suspend, | 324 | .suspend = ata_scsi_device_suspend, |
325 | #endif | ||
324 | }; | 326 | }; |
325 | 327 | ||
326 | static struct ata_port_operations serverworks_osb4_port_ops = { | 328 | static struct ata_port_operations serverworks_osb4_port_ops = { |
@@ -548,6 +550,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id | |||
548 | return ata_pci_init_one(pdev, port_info, ports); | 550 | return ata_pci_init_one(pdev, port_info, ports); |
549 | } | 551 | } |
550 | 552 | ||
553 | #ifdef CONFIG_PM | ||
551 | static int serverworks_reinit_one(struct pci_dev *pdev) | 554 | static int serverworks_reinit_one(struct pci_dev *pdev) |
552 | { | 555 | { |
553 | /* Force master latency timer to 64 PCI clocks */ | 556 | /* Force master latency timer to 64 PCI clocks */ |
@@ -571,6 +574,7 @@ static int serverworks_reinit_one(struct pci_dev *pdev) | |||
571 | } | 574 | } |
572 | return ata_pci_device_resume(pdev); | 575 | return ata_pci_device_resume(pdev); |
573 | } | 576 | } |
577 | #endif | ||
574 | 578 | ||
575 | static const struct pci_device_id serverworks[] = { | 579 | static const struct pci_device_id serverworks[] = { |
576 | { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE), 0}, | 580 | { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE), 0}, |
@@ -587,8 +591,10 @@ static struct pci_driver serverworks_pci_driver = { | |||
587 | .id_table = serverworks, | 591 | .id_table = serverworks, |
588 | .probe = serverworks_init_one, | 592 | .probe = serverworks_init_one, |
589 | .remove = ata_pci_remove_one, | 593 | .remove = ata_pci_remove_one, |
594 | #ifdef CONFIG_PM | ||
590 | .suspend = ata_pci_device_suspend, | 595 | .suspend = ata_pci_device_suspend, |
591 | .resume = serverworks_reinit_one, | 596 | .resume = serverworks_reinit_one, |
597 | #endif | ||
592 | }; | 598 | }; |
593 | 599 | ||
594 | static int __init serverworks_init(void) | 600 | static int __init serverworks_init(void) |
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c index 48eb5e538996..dab2889a556f 100644 --- a/drivers/ata/pata_sil680.c +++ b/drivers/ata/pata_sil680.c | |||
@@ -381,11 +381,13 @@ static int sil680_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
381 | return ata_pci_init_one(pdev, port_info, 2); | 381 | return ata_pci_init_one(pdev, port_info, 2); |
382 | } | 382 | } |
383 | 383 | ||
384 | #ifdef CONFIG_PM | ||
384 | static int sil680_reinit_one(struct pci_dev *pdev) | 385 | static int sil680_reinit_one(struct pci_dev *pdev) |
385 | { | 386 | { |
386 | sil680_init_chip(pdev); | 387 | sil680_init_chip(pdev); |
387 | return ata_pci_device_resume(pdev); | 388 | return ata_pci_device_resume(pdev); |
388 | } | 389 | } |
390 | #endif | ||
389 | 391 | ||
390 | static const struct pci_device_id sil680[] = { | 392 | static const struct pci_device_id sil680[] = { |
391 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), }, | 393 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), }, |
@@ -398,8 +400,10 @@ static struct pci_driver sil680_pci_driver = { | |||
398 | .id_table = sil680, | 400 | .id_table = sil680, |
399 | .probe = sil680_init_one, | 401 | .probe = sil680_init_one, |
400 | .remove = ata_pci_remove_one, | 402 | .remove = ata_pci_remove_one, |
403 | #ifdef CONFIG_PM | ||
401 | .suspend = ata_pci_device_suspend, | 404 | .suspend = ata_pci_device_suspend, |
402 | .resume = sil680_reinit_one, | 405 | .resume = sil680_reinit_one, |
406 | #endif | ||
403 | }; | 407 | }; |
404 | 408 | ||
405 | static int __init sil680_init(void) | 409 | static int __init sil680_init(void) |
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index be300923b27e..f48207865930 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -575,8 +575,10 @@ static struct scsi_host_template sis_sht = { | |||
575 | .slave_configure = ata_scsi_slave_config, | 575 | .slave_configure = ata_scsi_slave_config, |
576 | .slave_destroy = ata_scsi_slave_destroy, | 576 | .slave_destroy = ata_scsi_slave_destroy, |
577 | .bios_param = ata_std_bios_param, | 577 | .bios_param = ata_std_bios_param, |
578 | #ifdef CONFIG_PM | ||
578 | .resume = ata_scsi_device_resume, | 579 | .resume = ata_scsi_device_resume, |
579 | .suspend = ata_scsi_device_suspend, | 580 | .suspend = ata_scsi_device_suspend, |
581 | #endif | ||
580 | }; | 582 | }; |
581 | 583 | ||
582 | static const struct ata_port_operations sis_133_ops = { | 584 | static const struct ata_port_operations sis_133_ops = { |
@@ -1032,8 +1034,10 @@ static struct pci_driver sis_pci_driver = { | |||
1032 | .id_table = sis_pci_tbl, | 1034 | .id_table = sis_pci_tbl, |
1033 | .probe = sis_init_one, | 1035 | .probe = sis_init_one, |
1034 | .remove = ata_pci_remove_one, | 1036 | .remove = ata_pci_remove_one, |
1037 | #ifdef CONFIG_PM | ||
1035 | .suspend = ata_pci_device_suspend, | 1038 | .suspend = ata_pci_device_suspend, |
1036 | .resume = ata_pci_device_resume, | 1039 | .resume = ata_pci_device_resume, |
1040 | #endif | ||
1037 | }; | 1041 | }; |
1038 | 1042 | ||
1039 | static int __init sis_init(void) | 1043 | static int __init sis_init(void) |
diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c index 453ab90b721e..71418f2a0cdb 100644 --- a/drivers/ata/pata_triflex.c +++ b/drivers/ata/pata_triflex.c | |||
@@ -193,8 +193,10 @@ static struct scsi_host_template triflex_sht = { | |||
193 | .slave_configure = ata_scsi_slave_config, | 193 | .slave_configure = ata_scsi_slave_config, |
194 | .slave_destroy = ata_scsi_slave_destroy, | 194 | .slave_destroy = ata_scsi_slave_destroy, |
195 | .bios_param = ata_std_bios_param, | 195 | .bios_param = ata_std_bios_param, |
196 | #ifdef CONFIG_PM | ||
196 | .resume = ata_scsi_device_resume, | 197 | .resume = ata_scsi_device_resume, |
197 | .suspend = ata_scsi_device_suspend, | 198 | .suspend = ata_scsi_device_suspend, |
199 | #endif | ||
198 | }; | 200 | }; |
199 | 201 | ||
200 | static struct ata_port_operations triflex_port_ops = { | 202 | static struct ata_port_operations triflex_port_ops = { |
@@ -260,8 +262,10 @@ static struct pci_driver triflex_pci_driver = { | |||
260 | .id_table = triflex, | 262 | .id_table = triflex, |
261 | .probe = triflex_init_one, | 263 | .probe = triflex_init_one, |
262 | .remove = ata_pci_remove_one, | 264 | .remove = ata_pci_remove_one, |
265 | #ifdef CONFIG_PM | ||
263 | .suspend = ata_pci_device_suspend, | 266 | .suspend = ata_pci_device_suspend, |
264 | .resume = ata_pci_device_resume, | 267 | .resume = ata_pci_device_resume, |
268 | #endif | ||
265 | }; | 269 | }; |
266 | 270 | ||
267 | static int __init triflex_init(void) | 271 | static int __init triflex_init(void) |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 20fc2d0dcfa1..946ade0e1f1b 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -305,8 +305,10 @@ static struct scsi_host_template via_sht = { | |||
305 | .slave_configure = ata_scsi_slave_config, | 305 | .slave_configure = ata_scsi_slave_config, |
306 | .slave_destroy = ata_scsi_slave_destroy, | 306 | .slave_destroy = ata_scsi_slave_destroy, |
307 | .bios_param = ata_std_bios_param, | 307 | .bios_param = ata_std_bios_param, |
308 | #ifdef CONFIG_PM | ||
308 | .resume = ata_scsi_device_resume, | 309 | .resume = ata_scsi_device_resume, |
309 | .suspend = ata_scsi_device_suspend, | 310 | .suspend = ata_scsi_device_suspend, |
311 | #endif | ||
310 | }; | 312 | }; |
311 | 313 | ||
312 | static struct ata_port_operations via_port_ops = { | 314 | static struct ata_port_operations via_port_ops = { |
@@ -560,6 +562,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
560 | return ata_pci_init_one(pdev, port_info, 2); | 562 | return ata_pci_init_one(pdev, port_info, 2); |
561 | } | 563 | } |
562 | 564 | ||
565 | #ifdef CONFIG_PM | ||
563 | /** | 566 | /** |
564 | * via_reinit_one - reinit after resume | 567 | * via_reinit_one - reinit after resume |
565 | * @pdev; PCI device | 568 | * @pdev; PCI device |
@@ -592,6 +595,7 @@ static int via_reinit_one(struct pci_dev *pdev) | |||
592 | } | 595 | } |
593 | return ata_pci_device_resume(pdev); | 596 | return ata_pci_device_resume(pdev); |
594 | } | 597 | } |
598 | #endif | ||
595 | 599 | ||
596 | static const struct pci_device_id via[] = { | 600 | static const struct pci_device_id via[] = { |
597 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, | 601 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, |
@@ -607,8 +611,10 @@ static struct pci_driver via_pci_driver = { | |||
607 | .id_table = via, | 611 | .id_table = via, |
608 | .probe = via_init_one, | 612 | .probe = via_init_one, |
609 | .remove = ata_pci_remove_one, | 613 | .remove = ata_pci_remove_one, |
614 | #ifdef CONFIG_PM | ||
610 | .suspend = ata_pci_device_suspend, | 615 | .suspend = ata_pci_device_suspend, |
611 | .resume = via_reinit_one, | 616 | .resume = via_reinit_one, |
617 | #endif | ||
612 | }; | 618 | }; |
613 | 619 | ||
614 | static int __init via_init(void) | 620 | static int __init via_init(void) |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index 31b636fac98e..3193a603d1a1 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -135,8 +135,10 @@ static struct scsi_host_template inic_sht = { | |||
135 | .slave_configure = inic_slave_config, | 135 | .slave_configure = inic_slave_config, |
136 | .slave_destroy = ata_scsi_slave_destroy, | 136 | .slave_destroy = ata_scsi_slave_destroy, |
137 | .bios_param = ata_std_bios_param, | 137 | .bios_param = ata_std_bios_param, |
138 | #ifdef CONFIG_PM | ||
138 | .suspend = ata_scsi_device_suspend, | 139 | .suspend = ata_scsi_device_suspend, |
139 | .resume = ata_scsi_device_resume, | 140 | .resume = ata_scsi_device_resume, |
141 | #endif | ||
140 | }; | 142 | }; |
141 | 143 | ||
142 | static const int scr_map[] = { | 144 | static const int scr_map[] = { |
@@ -632,6 +634,7 @@ static int init_controller(void __iomem *mmio_base, u16 hctl) | |||
632 | return 0; | 634 | return 0; |
633 | } | 635 | } |
634 | 636 | ||
637 | #ifdef CONFIG_PM | ||
635 | static int inic_pci_device_resume(struct pci_dev *pdev) | 638 | static int inic_pci_device_resume(struct pci_dev *pdev) |
636 | { | 639 | { |
637 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 640 | struct ata_host *host = dev_get_drvdata(&pdev->dev); |
@@ -642,7 +645,6 @@ static int inic_pci_device_resume(struct pci_dev *pdev) | |||
642 | ata_pci_device_do_resume(pdev); | 645 | ata_pci_device_do_resume(pdev); |
643 | 646 | ||
644 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { | 647 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { |
645 | printk("XXX\n"); | ||
646 | rc = init_controller(mmio_base, hpriv->cached_hctl); | 648 | rc = init_controller(mmio_base, hpriv->cached_hctl); |
647 | if (rc) | 649 | if (rc) |
648 | return rc; | 650 | return rc; |
@@ -652,6 +654,7 @@ static int inic_pci_device_resume(struct pci_dev *pdev) | |||
652 | 654 | ||
653 | return 0; | 655 | return 0; |
654 | } | 656 | } |
657 | #endif | ||
655 | 658 | ||
656 | static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 659 | static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
657 | { | 660 | { |
@@ -755,8 +758,10 @@ static const struct pci_device_id inic_pci_tbl[] = { | |||
755 | static struct pci_driver inic_pci_driver = { | 758 | static struct pci_driver inic_pci_driver = { |
756 | .name = DRV_NAME, | 759 | .name = DRV_NAME, |
757 | .id_table = inic_pci_tbl, | 760 | .id_table = inic_pci_tbl, |
761 | #ifdef CONFIG_PM | ||
758 | .suspend = ata_pci_device_suspend, | 762 | .suspend = ata_pci_device_suspend, |
759 | .resume = inic_pci_device_resume, | 763 | .resume = inic_pci_device_resume, |
764 | #endif | ||
760 | .probe = inic_init_one, | 765 | .probe = inic_init_one, |
761 | .remove = ata_pci_remove_one, | 766 | .remove = ata_pci_remove_one, |
762 | }; | 767 | }; |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 30eed12b3631..388d07fab5f7 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -230,7 +230,9 @@ struct nv_host_priv { | |||
230 | 230 | ||
231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
232 | static void nv_remove_one (struct pci_dev *pdev); | 232 | static void nv_remove_one (struct pci_dev *pdev); |
233 | #ifdef CONFIG_PM | ||
233 | static int nv_pci_device_resume(struct pci_dev *pdev); | 234 | static int nv_pci_device_resume(struct pci_dev *pdev); |
235 | #endif | ||
234 | static void nv_ck804_host_stop(struct ata_host *host); | 236 | static void nv_ck804_host_stop(struct ata_host *host); |
235 | static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); | 237 | static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); |
236 | static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); | 238 | static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); |
@@ -251,8 +253,10 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance); | |||
251 | static void nv_adma_irq_clear(struct ata_port *ap); | 253 | static void nv_adma_irq_clear(struct ata_port *ap); |
252 | static int nv_adma_port_start(struct ata_port *ap); | 254 | static int nv_adma_port_start(struct ata_port *ap); |
253 | static void nv_adma_port_stop(struct ata_port *ap); | 255 | static void nv_adma_port_stop(struct ata_port *ap); |
256 | #ifdef CONFIG_PM | ||
254 | static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg); | 257 | static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg); |
255 | static int nv_adma_port_resume(struct ata_port *ap); | 258 | static int nv_adma_port_resume(struct ata_port *ap); |
259 | #endif | ||
256 | static void nv_adma_error_handler(struct ata_port *ap); | 260 | static void nv_adma_error_handler(struct ata_port *ap); |
257 | static void nv_adma_host_stop(struct ata_host *host); | 261 | static void nv_adma_host_stop(struct ata_host *host); |
258 | static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc); | 262 | static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc); |
@@ -295,8 +299,10 @@ static struct pci_driver nv_pci_driver = { | |||
295 | .name = DRV_NAME, | 299 | .name = DRV_NAME, |
296 | .id_table = nv_pci_tbl, | 300 | .id_table = nv_pci_tbl, |
297 | .probe = nv_init_one, | 301 | .probe = nv_init_one, |
302 | #ifdef CONFIG_PM | ||
298 | .suspend = ata_pci_device_suspend, | 303 | .suspend = ata_pci_device_suspend, |
299 | .resume = nv_pci_device_resume, | 304 | .resume = nv_pci_device_resume, |
305 | #endif | ||
300 | .remove = nv_remove_one, | 306 | .remove = nv_remove_one, |
301 | }; | 307 | }; |
302 | 308 | ||
@@ -316,8 +322,10 @@ static struct scsi_host_template nv_sht = { | |||
316 | .slave_configure = ata_scsi_slave_config, | 322 | .slave_configure = ata_scsi_slave_config, |
317 | .slave_destroy = ata_scsi_slave_destroy, | 323 | .slave_destroy = ata_scsi_slave_destroy, |
318 | .bios_param = ata_std_bios_param, | 324 | .bios_param = ata_std_bios_param, |
325 | #ifdef CONFIG_PM | ||
319 | .suspend = ata_scsi_device_suspend, | 326 | .suspend = ata_scsi_device_suspend, |
320 | .resume = ata_scsi_device_resume, | 327 | .resume = ata_scsi_device_resume, |
328 | #endif | ||
321 | }; | 329 | }; |
322 | 330 | ||
323 | static struct scsi_host_template nv_adma_sht = { | 331 | static struct scsi_host_template nv_adma_sht = { |
@@ -336,8 +344,10 @@ static struct scsi_host_template nv_adma_sht = { | |||
336 | .slave_configure = nv_adma_slave_config, | 344 | .slave_configure = nv_adma_slave_config, |
337 | .slave_destroy = ata_scsi_slave_destroy, | 345 | .slave_destroy = ata_scsi_slave_destroy, |
338 | .bios_param = ata_std_bios_param, | 346 | .bios_param = ata_std_bios_param, |
347 | #ifdef CONFIG_PM | ||
339 | .suspend = ata_scsi_device_suspend, | 348 | .suspend = ata_scsi_device_suspend, |
340 | .resume = ata_scsi_device_resume, | 349 | .resume = ata_scsi_device_resume, |
350 | #endif | ||
341 | }; | 351 | }; |
342 | 352 | ||
343 | static const struct ata_port_operations nv_generic_ops = { | 353 | static const struct ata_port_operations nv_generic_ops = { |
@@ -449,8 +459,10 @@ static const struct ata_port_operations nv_adma_ops = { | |||
449 | .scr_write = nv_scr_write, | 459 | .scr_write = nv_scr_write, |
450 | .port_start = nv_adma_port_start, | 460 | .port_start = nv_adma_port_start, |
451 | .port_stop = nv_adma_port_stop, | 461 | .port_stop = nv_adma_port_stop, |
462 | #ifdef CONFIG_PM | ||
452 | .port_suspend = nv_adma_port_suspend, | 463 | .port_suspend = nv_adma_port_suspend, |
453 | .port_resume = nv_adma_port_resume, | 464 | .port_resume = nv_adma_port_resume, |
465 | #endif | ||
454 | .host_stop = nv_adma_host_stop, | 466 | .host_stop = nv_adma_host_stop, |
455 | }; | 467 | }; |
456 | 468 | ||
@@ -1003,6 +1015,7 @@ static void nv_adma_port_stop(struct ata_port *ap) | |||
1003 | writew(0, mmio + NV_ADMA_CTL); | 1015 | writew(0, mmio + NV_ADMA_CTL); |
1004 | } | 1016 | } |
1005 | 1017 | ||
1018 | #ifdef CONFIG_PM | ||
1006 | static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg) | 1019 | static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg) |
1007 | { | 1020 | { |
1008 | struct nv_adma_port_priv *pp = ap->private_data; | 1021 | struct nv_adma_port_priv *pp = ap->private_data; |
@@ -1053,6 +1066,7 @@ static int nv_adma_port_resume(struct ata_port *ap) | |||
1053 | 1066 | ||
1054 | return 0; | 1067 | return 0; |
1055 | } | 1068 | } |
1069 | #endif | ||
1056 | 1070 | ||
1057 | static void nv_adma_setup_port(struct ata_probe_ent *probe_ent, unsigned int port) | 1071 | static void nv_adma_setup_port(struct ata_probe_ent *probe_ent, unsigned int port) |
1058 | { | 1072 | { |
@@ -1555,6 +1569,7 @@ static void nv_remove_one (struct pci_dev *pdev) | |||
1555 | kfree(hpriv); | 1569 | kfree(hpriv); |
1556 | } | 1570 | } |
1557 | 1571 | ||
1572 | #ifdef CONFIG_PM | ||
1558 | static int nv_pci_device_resume(struct pci_dev *pdev) | 1573 | static int nv_pci_device_resume(struct pci_dev *pdev) |
1559 | { | 1574 | { |
1560 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 1575 | struct ata_host *host = dev_get_drvdata(&pdev->dev); |
@@ -1602,6 +1617,7 @@ static int nv_pci_device_resume(struct pci_dev *pdev) | |||
1602 | 1617 | ||
1603 | return 0; | 1618 | return 0; |
1604 | } | 1619 | } |
1620 | #endif | ||
1605 | 1621 | ||
1606 | static void nv_ck804_host_stop(struct ata_host *host) | 1622 | static void nv_ck804_host_stop(struct ata_host *host) |
1607 | { | 1623 | { |
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index f7179c646bef..917b7ea4ef7c 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -183,8 +183,10 @@ static struct scsi_host_template sil_sht = { | |||
183 | .slave_configure = ata_scsi_slave_config, | 183 | .slave_configure = ata_scsi_slave_config, |
184 | .slave_destroy = ata_scsi_slave_destroy, | 184 | .slave_destroy = ata_scsi_slave_destroy, |
185 | .bios_param = ata_std_bios_param, | 185 | .bios_param = ata_std_bios_param, |
186 | #ifdef CONFIG_PM | ||
186 | .suspend = ata_scsi_device_suspend, | 187 | .suspend = ata_scsi_device_suspend, |
187 | .resume = ata_scsi_device_resume, | 188 | .resume = ata_scsi_device_resume, |
189 | #endif | ||
188 | }; | 190 | }; |
189 | 191 | ||
190 | static const struct ata_port_operations sil_ops = { | 192 | static const struct ata_port_operations sil_ops = { |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index b1bab82b16de..75d961599651 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -380,8 +380,10 @@ static struct scsi_host_template sil24_sht = { | |||
380 | .slave_configure = ata_scsi_slave_config, | 380 | .slave_configure = ata_scsi_slave_config, |
381 | .slave_destroy = ata_scsi_slave_destroy, | 381 | .slave_destroy = ata_scsi_slave_destroy, |
382 | .bios_param = ata_std_bios_param, | 382 | .bios_param = ata_std_bios_param, |
383 | #ifdef CONFIG_PM | ||
383 | .suspend = ata_scsi_device_suspend, | 384 | .suspend = ata_scsi_device_suspend, |
384 | .resume = ata_scsi_device_resume, | 385 | .resume = ata_scsi_device_resume, |
386 | #endif | ||
385 | }; | 387 | }; |
386 | 388 | ||
387 | static const struct ata_port_operations sil24_ops = { | 389 | static const struct ata_port_operations sil24_ops = { |