[PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
[safe/jmp/linux-2.6] / drivers / ata / pata_sl82c105.c
index 2d14b25..98548f6 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * pata_sl82c105.c     - SL82C105 PATA for new ATA layer
  *                       (C) 2005 Red Hat Inc
- *                       Alan Cox <alan@redhat.com>
  *
  * Based in part on linux/drivers/ide/pci/sl82c105.c
  *             SL82C105/Winbond 553 IDE driver
@@ -60,13 +59,7 @@ static int sl82c105_pre_reset(struct ata_link *link, unsigned long deadline)
 
        if (ap->port_no && !pci_test_config_bits(pdev, &sl82c105_enable_bits[ap->port_no]))
                return -ENOENT;
-       return ata_std_prereset(link, deadline);
-}
-
-
-static void sl82c105_error_handler(struct ata_port *ap)
-{
-       ata_bmdma_drive_eh(ap, sl82c105_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
+       return ata_sff_prereset(link, deadline);
 }
 
 
@@ -222,7 +215,7 @@ static int sl82c105_qc_defer(struct ata_queued_cmd *qc)
        struct ata_port *alt = host->ports[1 ^ qc->ap->port_no];
        int rc;
 
-       /* First apply the usual rules */       
+       /* First apply the usual rules */
        rc = ata_std_qc_defer(qc);
        if (rc != 0)
                return rc;
@@ -245,7 +238,7 @@ static struct ata_port_operations sl82c105_port_ops = {
        .bmdma_stop     = sl82c105_bmdma_stop,
        .cable_detect   = ata_cable_40wire,
        .set_piomode    = sl82c105_set_piomode,
-       .error_handler  = sl82c105_error_handler,
+       .prereset       = sl82c105_pre_reset,
 };
 
 /**
@@ -290,13 +283,13 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id
 {
        static const struct ata_port_info info_dma = {
                .flags = ATA_FLAG_SLAVE_POSS,
-               .pio_mask = 0x1f,
-               .mwdma_mask = 0x07,
+               .pio_mask = ATA_PIO4,
+               .mwdma_mask = ATA_MWDMA2,
                .port_ops = &sl82c105_port_ops
        };
        static const struct ata_port_info info_early = {
                .flags = ATA_FLAG_SLAVE_POSS,
-               .pio_mask = 0x1f,
+               .pio_mask = ATA_PIO4,
                .port_ops = &sl82c105_port_ops
        };
        /* for now use only the first port */
@@ -323,7 +316,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id
        val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
        pci_write_config_dword(dev, 0x40, val);
 
-       return ata_pci_init_one(dev, ppi, &sl82c105_sht);
+       return ata_pci_bmdma_init_one(dev, ppi, &sl82c105_sht, NULL, 0);
 }
 
 static const struct pci_device_id sl82c105[] = {