Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[cascardo/linux.git] / drivers / ata / sata_nv.c
index a097595..b265686 100644 (file)
@@ -49,7 +49,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME                       "sata_nv"
-#define DRV_VERSION                    "3.3"
+#define DRV_VERSION                    "3.4"
 
 #define NV_ADMA_DMA_BOUNDARY           0xffffffffUL
 
@@ -229,7 +229,6 @@ struct nv_host_priv {
 #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT)))))
 
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
-static void nv_remove_one (struct pci_dev *pdev);
 #ifdef CONFIG_PM
 static int nv_pci_device_resume(struct pci_dev *pdev);
 #endif
@@ -288,12 +287,6 @@ static const struct pci_device_id nv_pci_tbl[] = {
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
-       { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
-               PCI_ANY_ID, PCI_ANY_ID,
-               PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
-       { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
-               PCI_ANY_ID, PCI_ANY_ID,
-               PCI_CLASS_STORAGE_RAID<<8, 0xffff00, GENERIC },
 
        { } /* terminate list */
 };
@@ -306,7 +299,7 @@ static struct pci_driver nv_pci_driver = {
        .suspend                = ata_pci_device_suspend,
        .resume                 = nv_pci_device_resume,
 #endif
-       .remove                 = nv_remove_one,
+       .remove                 = ata_pci_remove_one,
 };
 
 static struct scsi_host_template nv_sht = {
@@ -325,10 +318,6 @@ static struct scsi_host_template nv_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-#ifdef CONFIG_PM
-       .suspend                = ata_scsi_device_suspend,
-       .resume                 = ata_scsi_device_resume,
-#endif
 };
 
 static struct scsi_host_template nv_adma_sht = {
@@ -336,6 +325,7 @@ static struct scsi_host_template nv_adma_sht = {
        .name                   = DRV_NAME,
        .ioctl                  = ata_scsi_ioctl,
        .queuecommand           = ata_scsi_queuecmd,
+       .change_queue_depth     = ata_scsi_change_queue_depth,
        .can_queue              = NV_ADMA_MAX_CPBS,
        .this_id                = ATA_SHT_THIS_ID,
        .sg_tablesize           = NV_ADMA_SGTBL_TOTAL_LEN,
@@ -347,10 +337,6 @@ static struct scsi_host_template nv_adma_sht = {
        .slave_configure        = nv_adma_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-#ifdef CONFIG_PM
-       .suspend                = ata_scsi_device_suspend,
-       .resume                 = ata_scsi_device_resume,
-#endif
 };
 
 static const struct ata_port_operations nv_generic_ops = {
@@ -465,7 +451,7 @@ static const struct ata_port_operations nv_adma_ops = {
        .host_stop              = nv_adma_host_stop,
 };
 
-static struct ata_port_info nv_port_info[] = {
+static const struct ata_port_info nv_port_info[] = {
        /* generic */
        {
                .sht            = &nv_sht,
@@ -817,7 +803,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
                        u16 status;
                        u32 gen_ctl;
                        u32 notifier, notifier_error;
-                       
+
                        /* if ADMA is disabled, use standard ata interrupt handler */
                        if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
                                u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804)
@@ -978,7 +964,7 @@ static void nv_adma_irq_clear(struct ata_port *ap)
 
        /* clear ADMA status */
        writew(0xffff, mmio + NV_ADMA_STAT);
-       
+
        /* clear notifiers - note both ports need to be written with
           something even though we are only clearing on one */
        if (ap->port_no == 0) {
@@ -1545,7 +1531,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version = 0;
-       const struct ata_port_info *ppi[2];
+       const struct ata_port_info *ppi[] = { NULL, NULL };
        struct ata_host *host;
        struct nv_host_priv *hpriv;
        int rc;
@@ -1573,8 +1559,8 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                type = ADMA;
        }
 
-       ppi[0] = ppi[1] = &nv_port_info[type];
-       rc = ata_pci_prepare_native_host(pdev, ppi, 2, &host);
+       ppi[0] = &nv_port_info[type];
+       rc = ata_pci_prepare_native_host(pdev, ppi, &host);
        if (rc)
                return rc;
 
@@ -1621,15 +1607,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                                 IRQF_SHARED, ppi[0]->sht);
 }
 
-static void nv_remove_one (struct pci_dev *pdev)
-{
-       struct ata_host *host = dev_get_drvdata(&pdev->dev);
-       struct nv_host_priv *hpriv = host->private_data;
-
-       ata_pci_remove_one(pdev);
-       kfree(hpriv);
-}
-
 #ifdef CONFIG_PM
 static int nv_pci_device_resume(struct pci_dev *pdev)
 {