ahci: request all PCI BARs
[safe/jmp/linux-2.6] / drivers / ata / pata_cmd640.c
index ab9468d..43d198f 100644 (file)
@@ -107,7 +107,7 @@ static void cmd640_set_piomode(struct ata_port *ap, struct ata_device *adev)
                pci_write_config_byte(pdev, arttim + 1, (t.active << 4) | t.recover);
        } else {
                /* Save the shared timings for channel, they will be loaded
-                  by qc_issue_prot. Reloading the setup time is expensive 
+                  by qc_issue_prot. Reloading the setup time is expensive
                   so we keep a merged one loaded */
                pci_read_config_byte(pdev, ARTIM23, &reg);
                reg &= 0x3F;
@@ -153,7 +153,7 @@ static int cmd640_port_start(struct ata_port *ap)
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        struct cmd640_reg *timing;
 
-       int ret = ata_port_start(ap);
+       int ret = ata_sff_port_start(ap);
        if (ret < 0)
                return ret;
 
@@ -181,12 +181,9 @@ static struct scsi_host_template cmd640_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-       .resume                 = ata_scsi_device_resume,
-       .suspend                = ata_scsi_device_suspend,
 };
 
 static struct ata_port_operations cmd640_port_ops = {
-       .port_disable   = ata_port_disable,
        .set_piomode    = cmd640_set_piomode,
        .mode_filter    = ata_pci_default_filter,
        .tf_load        = ata_tf_load,
@@ -215,7 +212,6 @@ static struct ata_port_operations cmd640_port_ops = {
        .irq_handler    = ata_interrupt,
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
-       .irq_ack        = ata_irq_ack,
 
        .port_start     = cmd640_port_start,
 };
@@ -233,7 +229,7 @@ static void cmd640_hardware_init(struct pci_dev *pdev)
        pci_write_config_byte(pdev, CMDTIM, 0);
        /* 512 byte bursts (sector) */
        pci_write_config_byte(pdev, BRST, 0x40);
-       /* 
+       /*
         * A reporter a long time ago
         * Had problems with the data fifo
         * So don't run the risk
@@ -251,23 +247,26 @@ static void cmd640_hardware_init(struct pci_dev *pdev)
 
 static int cmd640_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-       static struct ata_port_info info = {
+       static const struct ata_port_info info = {
                .sht = &cmd640_sht,
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+               .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .port_ops = &cmd640_port_ops
        };
-
-       static struct ata_port_info *port_info[2] = { &info, &info };
+       const struct ata_port_info *ppi[] = { &info, NULL };
 
        cmd640_hardware_init(pdev);
-       return ata_pci_init_one(pdev, port_info, 2);
+       return ata_pci_init_one(pdev, ppi);
 }
 
 static int cmd640_reinit_one(struct pci_dev *pdev)
 {
        cmd640_hardware_init(pdev);
+#ifdef CONFIG_PM
        return ata_pci_device_resume(pdev);
+#else
+       return 0;
+#endif
 }
 
 static const struct pci_device_id cmd640[] = {
@@ -280,7 +279,9 @@ static struct pci_driver cmd640_pci_driver = {
        .id_table       = cmd640,
        .probe          = cmd640_init_one,
        .remove         = ata_pci_remove_one,
+#ifdef CONFIG_PM
        .suspend        = ata_pci_device_suspend,
+#endif
        .resume         = cmd640_reinit_one,
 };