Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[cascardo/linux.git] / drivers / ata / pata_serverworks.c
index 3956ef2..8969154 100644 (file)
@@ -41,7 +41,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_serverworks"
-#define DRV_VERSION "0.4.0"
+#define DRV_VERSION "0.4.1"
 
 #define SVWKS_CSB5_REVISION_NEW        0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
 #define SVWKS_CSB6_REVISION    0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */
@@ -139,12 +139,14 @@ static struct sv_cable_table cable_detect[] = {
 /**
  *     serverworks_cable_detect        -       cable detection
  *     @ap: ATA port
+ *     @deadline: deadline jiffies for the operation
  *
  *     Perform cable detection according to the device and subvendor
  *     identifications
  */
 
-static int serverworks_cable_detect(struct ata_port *ap) {
+static int serverworks_cable_detect(struct ata_port *ap)
+{
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        struct sv_cable_table *cb = cable_detect;
 
@@ -313,10 +315,6 @@ static struct scsi_host_template serverworks_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-#ifdef CONFIG_PM
-       .resume                 = ata_scsi_device_resume,
-       .suspend                = ata_scsi_device_suspend,
-#endif
 };
 
 static struct ata_port_operations serverworks_osb4_port_ops = {
@@ -412,11 +410,8 @@ static int serverworks_fixup_osb4(struct pci_dev *pdev)
 
 static int serverworks_fixup_csb(struct pci_dev *pdev)
 {
-       u8 rev;
        u8 btr;
 
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
-
        /* Third Channel Test */
        if (!(PCI_FUNC(pdev->devfn) & 1)) {
                struct pci_dev * findev = NULL;
@@ -458,7 +453,7 @@ static int serverworks_fixup_csb(struct pci_dev *pdev)
        if (!(PCI_FUNC(pdev->devfn) & 1))
                btr |= 0x2;
        else
-               btr |= (rev >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2;
+               btr |= (pdev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2;
        pci_write_config_byte(pdev, 0x5A, btr);
 
        return btr;
@@ -477,40 +472,38 @@ static void serverworks_fixup_ht1000(struct pci_dev *pdev)
 
 static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-       int ports = 2;
-       static struct ata_port_info info[4] = {
+       static const struct ata_port_info info[4] = {
                { /* OSB4 */
                        .sht = &serverworks_sht,
-                       .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+                       .flags = ATA_FLAG_SLAVE_POSS,
                        .pio_mask = 0x1f,
                        .mwdma_mask = 0x07,
                        .udma_mask = 0x07,
                        .port_ops = &serverworks_osb4_port_ops
                }, { /* OSB4 no UDMA */
                        .sht = &serverworks_sht,
-                       .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+                       .flags = ATA_FLAG_SLAVE_POSS,
                        .pio_mask = 0x1f,
                        .mwdma_mask = 0x07,
                        .udma_mask = 0x00,
                        .port_ops = &serverworks_osb4_port_ops
                }, { /* CSB5 */
                        .sht = &serverworks_sht,
-                       .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+                       .flags = ATA_FLAG_SLAVE_POSS,
                        .pio_mask = 0x1f,
                        .mwdma_mask = 0x07,
-                       .udma_mask = 0x1f,
+                       .udma_mask = ATA_UDMA4,
                        .port_ops = &serverworks_csb_port_ops
                }, { /* CSB5 - later revisions*/
                        .sht = &serverworks_sht,
-                       .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+                       .flags = ATA_FLAG_SLAVE_POSS,
                        .pio_mask = 0x1f,
                        .mwdma_mask = 0x07,
-                       .udma_mask = 0x3f,
+                       .udma_mask = ATA_UDMA5,
                        .port_ops = &serverworks_csb_port_ops
                }
        };
-       static struct ata_port_info *port_info[2];
-       struct ata_port_info *devinfo = &info[id->driver_data];
+       const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL };
 
        /* Force master latency timer to 64 PCI clocks */
        pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
@@ -519,7 +512,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
        if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
                /* Select non UDMA capable OSB4 if we can't do fixups */
                if ( serverworks_fixup_osb4(pdev) < 0)
-                       devinfo = &info[1];
+                       ppi[0] = &info[1];
        }
        /* setup CSB5/CSB6 : South Bridge and IDE option RAID */
        else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ||
@@ -529,11 +522,11 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
                 /* If the returned btr is the newer revision then
                    select the right info block */
                 if (serverworks_fixup_csb(pdev) == 3)
-                       devinfo = &info[3];
+                       ppi[0] = &info[3];
 
                /* Is this the 3rd channel CSB6 IDE ? */
                if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)
-                       ports = 1;
+                       ppi[1] = &ata_dummy_port_info;
        }
        /* setup HT1000E */
        else if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE)
@@ -542,8 +535,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
        if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
                ata_pci_clear_simplex(pdev);
 
-       port_info[0] = port_info[1] = devinfo;
-       return ata_pci_init_one(pdev, port_info, ports);
+       return ata_pci_init_one(pdev, ppi);
 }
 
 #ifdef CONFIG_PM