vserver 1.9.5.x5
[linux-2.6.git] / drivers / scsi / sata_svw.c
index fd01225..444542e 100644 (file)
@@ -49,7 +49,7 @@
 #endif /* CONFIG_PPC_OF */
 
 #define DRV_NAME       "sata_svw"
-#define DRV_VERSION    "1.04"
+#define DRV_VERSION    "1.05"
 
 /* Taskfile registers offsets */
 #define K2_SATA_TF_CMD_OFFSET          0x00
@@ -245,7 +245,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
                return 0;
 
        /* Find the OF node for the PCI device proper */
-       np = pci_device_to_OF_node(ap->host_set->pdev);
+       np = pci_device_to_OF_node(to_pci_dev(ap->host_set->dev));
        if (np == NULL)
                return 0;
 
@@ -301,6 +301,8 @@ static struct ata_port_operations k2_sata_ops = {
        .phy_reset              = sata_phy_reset,
        .bmdma_setup            = k2_bmdma_setup_mmio,
        .bmdma_start            = k2_bmdma_start_mmio,
+       .bmdma_stop             = ata_bmdma_stop,
+       .bmdma_status           = ata_bmdma_status,
        .qc_prep                = ata_qc_prep,
        .qc_issue               = ata_qc_issue_prot,
        .eng_timeout            = ata_eng_timeout,
@@ -338,6 +340,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        struct ata_probe_ent *probe_ent = NULL;
        unsigned long base;
        void *mmio_base;
+       int pci_dev_busy = 0;
        int rc;
 
        if (!printed_version++)
@@ -359,8 +362,10 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
 
        /* Request PCI regions */
        rc = pci_request_regions(pdev, DRV_NAME);
-       if (rc)
+       if (rc) {
+               pci_dev_busy = 1;
                goto err_out;
+       }
 
        rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
        if (rc)
@@ -376,7 +381,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        }
 
        memset(probe_ent, 0, sizeof(*probe_ent));
-       probe_ent->pdev = pdev;
+       probe_ent->dev = pci_dev_to_dev(pdev);
        INIT_LIST_HEAD(&probe_ent->node);
 
        mmio_base = ioremap(pci_resource_start(pdev, 5),
@@ -433,7 +438,8 @@ err_out_free_ent:
 err_out_regions:
        pci_release_regions(pdev);
 err_out:
-       pci_disable_device(pdev);
+       if (!pci_dev_busy)
+               pci_disable_device(pdev);
        return rc;
 }
 
@@ -470,6 +476,7 @@ MODULE_AUTHOR("Benjamin Herrenschmidt");
 MODULE_DESCRIPTION("low-level driver for K2 SATA controller");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, k2_sata_pci_tbl);
+MODULE_VERSION(DRV_VERSION);
 
 module_init(k2_sata_init);
 module_exit(k2_sata_exit);