libata: don't use on-stack sense buffer
[safe/jmp/linux-2.6] / drivers / ata / pata_sis.c
index 3ed6286..27ceb42 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *    pata_sis.c - SiS ATA driver
  *
- *     (C) 2005 Red Hat <alan@redhat.com>
+ *     (C) 2005 Red Hat
  *     (C) 2007 Bartlomiej Zolnierkiewicz
  *
  *    Based upon linux/drivers/ide/pci/sis5513.c
@@ -112,7 +112,6 @@ static int sis_133_cable_detect(struct ata_port *ap)
 /**
  *     sis_66_cable_detect     -       check for 40/80 pin
  *     @ap: Port
- *     @deadline: deadline jiffies for the operation
  *
  *     Perform cable detection on the UDMA66, UDMA100 and early UDMA133
  *     SiS IDE controllers.
@@ -156,24 +155,11 @@ static int sis_pre_reset(struct ata_link *link, unsigned long deadline)
        /* Clear the FIFO settings. We can't enable the FIFO until
           we know we are poking at a disk */
        pci_write_config_byte(pdev, 0x4B, 0);
-       return ata_std_prereset(link, deadline);
+       return ata_sff_prereset(link, deadline);
 }
 
 
 /**
- *     sis_error_handler - Probe specified port on PATA host controller
- *     @ap: Port to probe
- *
- *     LOCKING:
- *     None (inherited from caller).
- */
-
-static void sis_error_handler(struct ata_port *ap)
-{
-       ata_bmdma_drive_eh(ap, sis_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
-}
-
-/**
  *     sis_set_fifo    -       Set RWP fifo bits for this device
  *     @ap: Port
  *     @adev: Device
@@ -526,7 +512,7 @@ static struct ata_port_operations sis_133_for_sata_ops = {
 
 static struct ata_port_operations sis_base_ops = {
        .inherits               = &ata_bmdma_port_ops,
-       .error_handler          = sis_error_handler,
+       .prereset               = sis_pre_reset,
 };
 
 static struct ata_port_operations sis_133_ops = {
@@ -565,7 +551,6 @@ static struct ata_port_operations sis_old_ops = {
 };
 
 static const struct ata_port_info sis_info = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .mwdma_mask     = 0x07,
@@ -573,7 +558,6 @@ static const struct ata_port_info sis_info = {
        .port_ops       = &sis_old_ops,
 };
 static const struct ata_port_info sis_info33 = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .mwdma_mask     = 0x07,
@@ -581,42 +565,36 @@ static const struct ata_port_info sis_info33 = {
        .port_ops       = &sis_old_ops,
 };
 static const struct ata_port_info sis_info66 = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .udma_mask      = ATA_UDMA4,    /* UDMA 66 */
        .port_ops       = &sis_66_ops,
 };
 static const struct ata_port_info sis_info100 = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .udma_mask      = ATA_UDMA5,
        .port_ops       = &sis_100_ops,
 };
 static const struct ata_port_info sis_info100_early = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .udma_mask      = ATA_UDMA5,
        .pio_mask       = 0x1f, /* pio0-4 */
        .port_ops       = &sis_66_ops,
 };
 static const struct ata_port_info sis_info133 = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .udma_mask      = ATA_UDMA6,
        .port_ops       = &sis_133_ops,
 };
 const struct ata_port_info sis_info133_for_sata = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
        .pio_mask       = 0x1f, /* pio0-4 */
        .udma_mask      = ATA_UDMA6,
        .port_ops       = &sis_133_for_sata_ops,
 };
 static const struct ata_port_info sis_info133_early = {
-       .sht            = &sis_sht,
        .flags          = ATA_FLAG_SLAVE_POSS,
        .pio_mask       = 0x1f, /* pio0-4 */
        .udma_mask      = ATA_UDMA6,
@@ -698,8 +676,7 @@ static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
 static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
-       struct ata_port_info port;
-       const struct ata_port_info *ppi[] = { &port, NULL };
+       const struct ata_port_info *ppi[] = { NULL, NULL };
        struct pci_dev *host = NULL;
        struct sis_chipset *chipset = NULL;
        struct sis_chipset *sets;
@@ -839,12 +816,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        if (chipset == NULL)
                return -ENODEV;
 
-       port = *chipset->info;
-       port.private_data = chipset;
+       ppi[0] = chipset->info;
 
        sis_fixup(pdev, chipset);
 
-       return ata_pci_init_one(pdev, ppi);
+       return ata_pci_sff_init_one(pdev, ppi, &sis_sht, chipset);
 }
 
 static const struct pci_device_id sis_pci_tbl[] = {