aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_serverworks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_serverworks.c')
-rw-r--r--drivers/ata/pata_serverworks.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index b6e020383dd9..dee6e211949d 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -315,10 +315,6 @@ static struct scsi_host_template serverworks_sht = {
315 .slave_configure = ata_scsi_slave_config, 315 .slave_configure = ata_scsi_slave_config,
316 .slave_destroy = ata_scsi_slave_destroy, 316 .slave_destroy = ata_scsi_slave_destroy,
317 .bios_param = ata_std_bios_param, 317 .bios_param = ata_std_bios_param,
318#ifdef CONFIG_PM
319 .resume = ata_scsi_device_resume,
320 .suspend = ata_scsi_device_suspend,
321#endif
322}; 318};
323 319
324static struct ata_port_operations serverworks_osb4_port_ops = { 320static struct ata_port_operations serverworks_osb4_port_ops = {
@@ -479,8 +475,7 @@ static void serverworks_fixup_ht1000(struct pci_dev *pdev)
479 475
480static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 476static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
481{ 477{
482 int ports = 2; 478 static const struct ata_port_info info[4] = {
483 static struct ata_port_info info[4] = {
484 { /* OSB4 */ 479 { /* OSB4 */
485 .sht = &serverworks_sht, 480 .sht = &serverworks_sht,
486 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 481 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
@@ -511,8 +506,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
511 .port_ops = &serverworks_csb_port_ops 506 .port_ops = &serverworks_csb_port_ops
512 } 507 }
513 }; 508 };
514 static struct ata_port_info *port_info[2]; 509 const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL };
515 struct ata_port_info *devinfo = &info[id->driver_data];
516 510
517 /* Force master latency timer to 64 PCI clocks */ 511 /* Force master latency timer to 64 PCI clocks */
518 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); 512 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
@@ -521,7 +515,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
521 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { 515 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
522 /* Select non UDMA capable OSB4 if we can't do fixups */ 516 /* Select non UDMA capable OSB4 if we can't do fixups */
523 if ( serverworks_fixup_osb4(pdev) < 0) 517 if ( serverworks_fixup_osb4(pdev) < 0)
524 devinfo = &info[1]; 518 ppi[0] = &info[1];
525 } 519 }
526 /* setup CSB5/CSB6 : South Bridge and IDE option RAID */ 520 /* setup CSB5/CSB6 : South Bridge and IDE option RAID */
527 else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) || 521 else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ||
@@ -531,11 +525,11 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
531 /* If the returned btr is the newer revision then 525 /* If the returned btr is the newer revision then
532 select the right info block */ 526 select the right info block */
533 if (serverworks_fixup_csb(pdev) == 3) 527 if (serverworks_fixup_csb(pdev) == 3)
534 devinfo = &info[3]; 528 ppi[0] = &info[3];
535 529
536 /* Is this the 3rd channel CSB6 IDE ? */ 530 /* Is this the 3rd channel CSB6 IDE ? */
537 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) 531 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)
538 ports = 1; 532 ppi[1] = &ata_dummy_port_info;
539 } 533 }
540 /* setup HT1000E */ 534 /* setup HT1000E */
541 else if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) 535 else if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE)
@@ -544,8 +538,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
544 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) 538 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
545 ata_pci_clear_simplex(pdev); 539 ata_pci_clear_simplex(pdev);
546 540
547 port_info[0] = port_info[1] = devinfo; 541 return ata_pci_init_one(pdev, ppi);
548 return ata_pci_init_one(pdev, port_info, ports);
549} 542}
550 543
551#ifdef CONFIG_PM 544#ifdef CONFIG_PM