Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[cascardo/linux.git] / drivers / ata / pata_optidma.c
index b70e04c..6b07b5b 100644 (file)
@@ -47,13 +47,15 @@ static int pci_clock;       /* 0 = 33 1 = 25 */
 
 /**
  *     optidma_pre_reset               -       probe begin
- *     @ap: ATA port
+ *     @link: ATA link
+ *     @deadline: deadline jiffies for the operation
  *
  *     Set up cable type and use generic probe init
  */
 
-static int optidma_pre_reset(struct ata_port *ap)
+static int optidma_pre_reset(struct ata_link *link, unsigned long deadline)
 {
+       struct ata_port *ap = link->ap;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        static const struct pci_bits optidma_enable_bits = {
                0x40, 1, 0x08, 0x00
@@ -62,7 +64,7 @@ static int optidma_pre_reset(struct ata_port *ap)
        if (ap->port_no && !pci_test_config_bits(pdev, &optidma_enable_bits))
                return -ENOENT;
 
-       return ata_std_prereset(ap);
+       return ata_std_prereset(link, deadline);
 }
 
 /**
@@ -322,25 +324,26 @@ static u8 optidma_make_bits43(struct ata_device *adev)
 
 /**
  *     optidma_set_mode        -       mode setup
- *     @ap: port to set up
+ *     @link: link to set up
  *
  *     Use the standard setup to tune the chipset and then finalise the
  *     configuration by writing the nibble of extra bits of data into
  *     the chip.
  */
 
-static int optidma_set_mode(struct ata_port *ap, struct ata_device **r_failed)
+static int optidma_set_mode(struct ata_link *link, struct ata_device **r_failed)
 {
+       struct ata_port *ap = link->ap;
        u8 r;
        int nybble = 4 * ap->port_no;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-       int rc  = ata_do_set_mode(ap, r_failed);
+       int rc  = ata_do_set_mode(link, r_failed);
        if (rc == 0) {
                pci_read_config_byte(pdev, 0x43, &r);
 
                r &= (0x0F << nybble);
-               r |= (optidma_make_bits43(&ap->device[0]) +
-                    (optidma_make_bits43(&ap->device[0]) << 2)) << nybble;
+               r |= (optidma_make_bits43(&link->device[0]) +
+                    (optidma_make_bits43(&link->device[0]) << 2)) << nybble;
                pci_write_config_byte(pdev, 0x43, r);
        }
        return rc;
@@ -362,14 +365,9 @@ static struct scsi_host_template optidma_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 optidma_port_ops = {
-       .port_disable   = ata_port_disable,
        .set_piomode    = optidma_set_pio_mode,
        .set_dmamode    = optidma_set_dma_mode,
 
@@ -399,13 +397,11 @@ static struct ata_port_operations optidma_port_ops = {
        .irq_handler    = ata_interrupt,
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
-       .irq_ack        = ata_irq_ack,
 
-       .port_start     = ata_port_start,
+       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations optiplus_port_ops = {
-       .port_disable   = ata_port_disable,
        .set_piomode    = optiplus_set_pio_mode,
        .set_dmamode    = optiplus_set_dma_mode,
 
@@ -435,9 +431,8 @@ static struct ata_port_operations optiplus_port_ops = {
        .irq_handler    = ata_interrupt,
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
-       .irq_ack        = ata_irq_ack,
 
-       .port_start     = ata_port_start,
+       .port_start     = ata_sff_port_start,
 };
 
 /**
@@ -485,23 +480,22 @@ done_nomsg:               /* Wrong chip revision */
 
 static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       static struct ata_port_info info_82c700 = {
+       static const struct ata_port_info info_82c700 = {
                .sht = &optidma_sht,
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+               .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
                .port_ops = &optidma_port_ops
        };
-       static struct ata_port_info info_82c700_udma = {
+       static const struct ata_port_info info_82c700_udma = {
                .sht = &optidma_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 = &optiplus_port_ops
        };
-       static struct ata_port_info *port_info[2];
-       struct ata_port_info *info = &info_82c700;
+       const struct ata_port_info *ppi[] = { &info_82c700, NULL };
        static int printed_version;
 
        if (!printed_version++)
@@ -513,10 +507,9 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        pci_clock = inb(0x1F5) & 1;             /* 0 = 33Mhz, 1 = 25Mhz */
 
        if (optiplus_with_udma(dev))
-               info = &info_82c700_udma;
+               ppi[0] = &info_82c700_udma;
 
-       port_info[0] = port_info[1] = info;
-       return ata_pci_init_one(dev, port_info, 2);
+       return ata_pci_init_one(dev, ppi);
 }
 
 static const struct pci_device_id optidma[] = {