Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
[sfrench/cifs-2.6.git] / drivers / ata / pata_hpt3x2n.c
index 6a34521b9e01a7ded70309d3b528c0d7b4f1410e..aa29cde09f8bbd594022f23a1e7803b6adfc5d87 100644 (file)
@@ -148,13 +148,14 @@ static int hpt3x2n_cable_detect(struct ata_port *ap)
  *     Reset the hardware and state machine,
  */
 
-static int hpt3xn_pre_reset(struct ata_port *ap)
+static int hpt3xn_pre_reset(struct ata_port *ap, unsigned long deadline)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        /* Reset the state machine */
        pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
        udelay(100);
-       return ata_std_prereset(ap);
+
+       return ata_std_prereset(ap, deadline);
 }
 
 /**
@@ -487,16 +488,16 @@ static int hpt3x2n_pci_clock(struct pci_dev *pdev)
 static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
        /* HPT372N and friends - UDMA133 */
-       static struct ata_port_info info = {
+       static const struct ata_port_info info = {
                .sht = &hpt3x2n_sht,
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+               .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
-               .udma_mask = 0x7f,
+               .udma_mask = ATA_UDMA6,
                .port_ops = &hpt3x2n_port_ops
        };
-       struct ata_port_info *port_info[2];
-       struct ata_port_info *port = &info;
+       struct ata_port_info port = info;
+       const struct ata_port_info *ppi[] = { &port, NULL };
 
        u8 irqmask;
        u32 class_rev;
@@ -520,8 +521,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        /* 371N if rev > 1 */
                        break;
                case PCI_DEVICE_ID_TTI_HPT372:
-                       /* 372N if rev >= 1*/
-                       if (class_rev == 0)
+                       /* 372N if rev >= 2*/
+                       if (class_rev < 2)
                                return -ENODEV;
                        break;
                case PCI_DEVICE_ID_TTI_HPT302:
@@ -584,9 +585,9 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 
        /* Set our private data up. We only need a few flags so we use
           it directly */
-       port->private_data = NULL;
+       port.private_data = NULL;
        if (pci_mhz > 60) {
-               port->private_data = (void *)PCI66;
+               port.private_data = (void *)PCI66;
                /*
                 * On  HPT371N, if ATA clock is 66 MHz we must set bit 2 in
                 * the MISC. register to stretch the UltraDMA Tss timing.
@@ -597,8 +598,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        }
 
        /* Now kick off ATA set up */
-       port_info[0] = port_info[1] = port;
-       return ata_pci_init_one(dev, port_info, 2);
+       return ata_pci_init_one(dev, ppi);
 }
 
 static const struct pci_device_id hpt3x2n[] = {