nfsd4: setclientid_confirm callback-change fixes
[safe/jmp/linux-2.6] / drivers / ata / pata_atiixp.c
index 56a65ba..bec0b8a 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * pata_atiixp.c       - ATI PATA for new ATA layer
  *                       (C) 2005 Red Hat Inc
- *                       Alan Cox <alan@redhat.com>
  *
  * Based on
  *
@@ -33,21 +32,6 @@ enum {
        ATIIXP_IDE_UDMA_MODE    = 0x56
 };
 
-static int atiixp_pre_reset(struct ata_link *link, unsigned long deadline)
-{
-       struct ata_port *ap = link->ap;
-       static const struct pci_bits atiixp_enable_bits[] = {
-               { 0x48, 1, 0x01, 0x00 },
-               { 0x48, 1, 0x08, 0x00 }
-       };
-       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-
-       if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
-               return -ENOENT;
-
-       return ata_std_prereset(link, deadline);
-}
-
 static int atiixp_cable_detect(struct ata_port *ap)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -88,8 +72,8 @@ static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev,
        pci_write_config_word(pdev, ATIIXP_IDE_PIO_MODE, pio_mode_data);
 
        pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
-       pio_mode_data &= ~(0xFF << timing_shift);
-       pio_mode_data |= (pio_timings[pio] << timing_shift);
+       pio_timing_data &= ~(0xFF << timing_shift);
+       pio_timing_data |= (pio_timings[pio] << timing_shift);
        pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);
 }
 
@@ -183,7 +167,7 @@ static void atiixp_bmdma_start(struct ata_queued_cmd *qc)
        u16 tmp16;
 
        pci_read_config_word(pdev, ATIIXP_IDE_UDMA_CONTROL, &tmp16);
-       if (adev->dma_mode >= XFER_UDMA_0)
+       if (ata_using_udma(adev))
                tmp16 |= (1 << dn);
        else
                tmp16 &= ~(1 << dn);
@@ -223,27 +207,36 @@ static struct scsi_host_template atiixp_sht = {
 static struct ata_port_operations atiixp_port_ops = {
        .inherits       = &ata_bmdma_port_ops,
 
-       .qc_prep        = ata_dumb_qc_prep,
+       .qc_prep        = ata_sff_dumb_qc_prep,
        .bmdma_start    = atiixp_bmdma_start,
        .bmdma_stop     = atiixp_bmdma_stop,
 
        .cable_detect   = atiixp_cable_detect,
        .set_piomode    = atiixp_set_piomode,
        .set_dmamode    = atiixp_set_dmamode,
-       .prereset       = atiixp_pre_reset,
 };
 
-static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
+static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
        static const struct ata_port_info info = {
                .flags = ATA_FLAG_SLAVE_POSS,
-               .pio_mask = 0x1f,
-               .mwdma_mask = 0x06,     /* No MWDMA0 support */
-               .udma_mask = 0x3F,
+               .pio_mask = ATA_PIO4,
+               .mwdma_mask = ATA_MWDMA12_ONLY,
+               .udma_mask = ATA_UDMA5,
                .port_ops = &atiixp_port_ops
        };
-       const struct ata_port_info *ppi[] = { &info, NULL };
-       return ata_pci_init_one(dev, ppi, &atiixp_sht, NULL);
+       static const struct pci_bits atiixp_enable_bits[] = {
+               { 0x48, 1, 0x01, 0x00 },
+               { 0x48, 1, 0x08, 0x00 }
+       };
+       const struct ata_port_info *ppi[] = { &info, &info };
+       int i;
+
+       for (i = 0; i < 2; i++)
+               if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
+                       ppi[i] = &ata_dummy_port_info;
+
+       return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
 }
 
 static const struct pci_device_id atiixp[] = {