]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: move read_sff_dma_status() method to 'struct ide_dma_ops'
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Tue, 6 Jan 2009 16:21:02 +0000 (17:21 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 6 Jan 2009 16:21:02 +0000 (17:21 +0100)
Move apparently misplaced read_sff_dma_status() method from 'struct ide_tp_ops'
to 'struct ide_dma_ops', renaming it to dma_sff_read_status() and making only
required for SFF-8038i compatible IDE controller drivers (greatly cutting down
the number of initializers) as its only user (outside ide-dma-sff.c and such
drivers) appears to be ide_pci_check_simplex() which is only called for such
controllers...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
23 files changed:
drivers/ide/alim15x3.c
drivers/ide/au1xxx-ide.c
drivers/ide/cmd64x.c
drivers/ide/falconide.c
drivers/ide/hpt366.c
drivers/ide/ide-dma-sff.c
drivers/ide/ide-h8300.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/ide/it821x.c
drivers/ide/ns87415.c
drivers/ide/pdc202xx_old.c
drivers/ide/pmac.c
drivers/ide/q40ide.c
drivers/ide/sc1200.c
drivers/ide/scc_pata.c
drivers/ide/setup-pci.c
drivers/ide/sgiioc4.c
drivers/ide/siimage.c
drivers/ide/sl82c105.c
drivers/ide/tc86c001.c
drivers/ide/tx4939ide.c
include/linux/ide.h

index f1c817240501e27f3bd4abc168cc75da3d79fd14..66f43083408b4762c940525b2348bde4a67c4fd3 100644 (file)
@@ -509,6 +509,7 @@ static const struct ide_dma_ops ali_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info ali15x3_chipset __devinitdata = {
index 11f2c8f3db48022a77339767b9aa2e7c42fd0dc1..79a2dfed8eb7b600603f68b8468c4ca2e7393a43 100644 (file)
@@ -502,7 +502,6 @@ static const struct ide_tp_ops au1xxx_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index 265cf9268c63c1621fe8878df54e0f4a6fa8f8d3..2f9688d87ecdc5eb192c67588bbcd51ea8094a41 100644 (file)
@@ -385,6 +385,7 @@ static const struct ide_dma_ops cmd64x_dma_ops = {
        .dma_test_irq           = cmd64x_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_dma_ops cmd646_rev1_dma_ops = {
@@ -396,6 +397,7 @@ static const struct ide_dma_ops cmd646_rev1_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_dma_ops cmd648_dma_ops = {
@@ -407,6 +409,7 @@ static const struct ide_dma_ops cmd648_dma_ops = {
        .dma_test_irq           = cmd648_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
index 39d500d84b07ee7b42fe80b22513558dad70ee50..a5ba820d69bbbeaa6dfb4e47d523599be78d7335 100644 (file)
@@ -70,7 +70,6 @@ static const struct ide_tp_ops falconide_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index 208614f4dc3c6dbc3cb827bf5fd833b4e26f28fc..3eb9b5c63a0f4a3a4c67facb6e7687a465f69936 100644 (file)
@@ -1424,6 +1424,7 @@ static const struct ide_dma_ops hpt37x_dma_ops = {
        .dma_test_irq           = hpt374_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_dma_ops hpt370_dma_ops = {
@@ -1435,6 +1436,7 @@ static const struct ide_dma_ops hpt370_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = hpt370_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_dma_ops hpt36x_dma_ops = {
@@ -1446,6 +1448,7 @@ static const struct ide_dma_ops hpt36x_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = hpt366_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
index 623a82d1535d5bcfeffcab1e178c435899c78d9f..bcdadc777564d634f87b601c3540b48d74bfcabb 100644 (file)
@@ -50,6 +50,17 @@ int config_drive_for_dma(ide_drive_t *drive)
        return 0;
 }
 
+u8 ide_dma_sff_read_status(ide_hwif_t *hwif)
+{
+       unsigned long addr = hwif->dma_base + ATA_DMA_STATUS;
+
+       if (hwif->host_flags & IDE_HFLAG_MMIO)
+               return readb((void __iomem *)addr);
+       else
+               return inb(addr);
+}
+EXPORT_SYMBOL_GPL(ide_dma_sff_read_status);
+
 /**
  *     ide_dma_host_set        -       Enable/disable DMA on a host
  *     @drive: drive to control
@@ -62,7 +73,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
 {
        ide_hwif_t *hwif = drive->hwif;
        u8 unit = drive->dn & 1;
-       u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
        if (on)
                dma_stat |= (1 << (5 + unit));
@@ -200,7 +211,7 @@ int ide_dma_setup(ide_drive_t *drive)
                outb(reading, hwif->dma_base + ATA_DMA_CMD);
 
        /* read DMA status for INTR & ERROR flags */
-       dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
        /* clear INTR & ERROR flags */
        if (mmio)
@@ -232,7 +243,7 @@ EXPORT_SYMBOL_GPL(ide_dma_setup);
 static int dma_timer_expiry(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
-       u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
        printk(KERN_WARNING "%s: %s: DMA status (0x%02x)\n",
                drive->name, __func__, dma_stat);
@@ -305,7 +316,7 @@ int ide_dma_end(ide_drive_t *drive)
        }
 
        /* get DMA status */
-       dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
        if (mmio)
                /* clear the INTR & ERROR bits */
@@ -331,7 +342,7 @@ EXPORT_SYMBOL_GPL(ide_dma_end);
 int ide_dma_test_irq(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
-       u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
        return (dma_stat & ATA_DMA_INTR) ? 1 : 0;
 }
@@ -346,5 +357,6 @@ const struct ide_dma_ops sff_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_timeout            = ide_dma_timeout,
        .dma_lost_irq           = ide_dma_lost_irq,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 EXPORT_SYMBOL_GPL(sff_dma_ops);
index e2cdd2e9cdecc70d388be220b3128d19efaf9de2..9270d3255ee04ebcb1fb732928847df5a9712201 100644 (file)
@@ -159,7 +159,6 @@ static const struct ide_tp_ops h8300_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index 1a22c31ce7acf521da29f95f910dec9b7926e2a0..e728cfe7273f2a84a15a83e497b98d9faab05211 100644 (file)
@@ -105,15 +105,6 @@ u8 ide_read_altstatus(ide_hwif_t *hwif)
 }
 EXPORT_SYMBOL_GPL(ide_read_altstatus);
 
-u8 ide_read_sff_dma_status(ide_hwif_t *hwif)
-{
-       if (hwif->host_flags & IDE_HFLAG_MMIO)
-               return readb((void __iomem *)(hwif->dma_base + ATA_DMA_STATUS));
-       else
-               return inb(hwif->dma_base + ATA_DMA_STATUS);
-}
-EXPORT_SYMBOL_GPL(ide_read_sff_dma_status);
-
 void ide_set_irq(ide_hwif_t *hwif, int on)
 {
        u8 ctl = ATA_DEVCTL_OBS;
@@ -388,7 +379,6 @@ const struct ide_tp_ops default_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index ebb1b7f863f4d57683d9b8af3b1d8970fd8bcebc..0ccbb4459fb913faf89370422071cf01d3c17e9a 100644 (file)
@@ -1229,6 +1229,8 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
        if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
                int rc;
 
+               hwif->dma_ops = d->dma_ops;
+
                if (d->init_dma)
                        rc = d->init_dma(hwif, d);
                else
@@ -1236,12 +1238,13 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
 
                if (rc < 0) {
                        printk(KERN_INFO "%s: DMA disabled\n", hwif->name);
+
+                       hwif->dma_ops = NULL;
                        hwif->dma_base = 0;
                        hwif->swdma_mask = 0;
                        hwif->mwdma_mask = 0;
                        hwif->ultra_mask = 0;
-               } else if (d->dma_ops)
-                       hwif->dma_ops = d->dma_ops;
+               }
        }
 
        if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
index 879056645352fa7f84aa93b48748d07ef9ad5df5..0be27ac1f07767854fb9bf98b4caa7723d3e68c0 100644 (file)
@@ -512,6 +512,7 @@ static struct ide_dma_ops it821x_pass_through_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_timeout            = ide_dma_timeout,
        .dma_lost_irq           = ide_dma_lost_irq,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 /**
index aceb2fcbe1d106757eea168716656bef7bc14fd4..83643ed9a426d1a43390987871e1839e5769d7eb 100644 (file)
@@ -56,7 +56,7 @@ static u8 superio_read_status(ide_hwif_t *hwif)
        return superio_ide_inb(hwif->io_ports.status_addr);
 }
 
-static u8 superio_read_sff_dma_status(ide_hwif_t *hwif)
+static u8 superio_dma_sff_read_status(ide_hwif_t *hwif)
 {
        return superio_ide_inb(hwif->dma_base + ATA_DMA_STATUS);
 }
@@ -109,7 +109,6 @@ static const struct ide_tp_ops superio_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = superio_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = superio_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
@@ -132,6 +131,8 @@ static void __devinit superio_init_iops(struct hwif_s *hwif)
        tmp = superio_ide_inb(dma_stat);
        outb(tmp | 0x66, dma_stat);
 }
+#else
+#define superio_dma_sff_read_status ide_dma_sff_read_status
 #endif
 
 static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 };
@@ -201,7 +202,7 @@ static int ns87415_dma_end(ide_drive_t *drive)
        u8 dma_stat = 0, dma_cmd = 0;
 
        drive->waiting_for_dma = 0;
-       dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
        /* get DMA command mode */
        dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
        /* stop DMA */
@@ -308,6 +309,7 @@ static const struct ide_dma_ops ns87415_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = superio_dma_sff_read_status,
 };
 
 static const struct ide_port_info ns87415_chipset __devinitdata = {
index e8e6b29d9e41095dd754dc194fea16f9f76292bd..97193323aebfb5e8cbafbf33849cc9fb066f2313 100644 (file)
@@ -337,6 +337,7 @@ static const struct ide_dma_ops pdc20246_dma_ops = {
        .dma_test_irq           = pdc202xx_dma_test_irq,
        .dma_lost_irq           = pdc202xx_dma_lost_irq,
        .dma_timeout            = pdc202xx_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_dma_ops pdc2026x_dma_ops = {
@@ -348,6 +349,7 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
        .dma_test_irq           = pdc202xx_dma_test_irq,
        .dma_lost_irq           = pdc202xx_dma_lost_irq,
        .dma_timeout            = pdc202xx_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 #define DECLARE_PDC2026X_DEV(udma, sectors) \
index ee52a21af1be8aac374d8e54f366a6aed109a1b7..74625e821a43bc078f6c1efe88312bb438872141 100644 (file)
@@ -955,7 +955,6 @@ static const struct ide_tp_ops pmac_tp_ops = {
        .exec_command           = pmac_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = pmac_set_irq,
 
index 4af4a8ce4cdf77befdecfdcb505d0f681203864f..9f9c0b3cc3a325de1596c625590c9a4161096ba3 100644 (file)
@@ -99,7 +99,6 @@ static const struct ide_tp_ops q40ide_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index 1cf477aaae361f81b1fa7dcdec50c99a0bcff057..dbdd2985a0d8f7f89b58df5cd9a440dc74df9918 100644 (file)
@@ -292,6 +292,7 @@ static const struct ide_dma_ops sc1200_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info sc1200_chipset __devinitdata = {
index 5d53850c79d7e63da24f63acc9d5c08c603eb43e..1cb43068455a21d22a9f8a44524adf09110870e3 100644 (file)
@@ -143,7 +143,7 @@ static u8 scc_read_altstatus(ide_hwif_t *hwif)
        return (u8)in_be32((void *)hwif->io_ports.ctl_addr);
 }
 
-static u8 scc_read_sff_dma_status(ide_hwif_t *hwif)
+static u8 scc_dma_sff_read_status(ide_hwif_t *hwif)
 {
        return (u8)in_be32((void *)(hwif->dma_base + 4));
 }
@@ -853,7 +853,6 @@ static const struct ide_tp_ops scc_tp_ops = {
        .exec_command           = scc_exec_command,
        .read_status            = scc_read_status,
        .read_altstatus         = scc_read_altstatus,
-       .read_sff_dma_status    = scc_read_sff_dma_status,
 
        .set_irq                = scc_set_irq,
 
@@ -880,6 +879,7 @@ static const struct ide_dma_ops scc_dma_ops = {
        .dma_test_irq           = scc_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = scc_dma_sff_read_status,
 };
 
 #define DECLARE_SCC_DEV(name_str)                      \
index bc37dff8c675f5295840a0ea4faac97f0ae0cdee..e85d1ed29c2ac005d37928d61e0d439534f8c9dd 100644 (file)
@@ -130,7 +130,7 @@ int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d)
         * we tune the drive then try to grab DMA ownership if we want to be
         * the DMA end.  This has to be become dynamic to handle hot-plug.
         */
-       dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
+       dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
        if ((dma_stat & 0x80) && hwif->mate && hwif->mate->dma_base) {
                printk(KERN_INFO "%s %s: simplex device: DMA disabled\n",
                        d->name, pci_name(dev));
@@ -377,6 +377,9 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
 
                hwif->dma_base = base;
 
+               if (hwif->dma_ops == NULL)
+                       hwif->dma_ops = &sff_dma_ops;
+
                if (ide_pci_check_simplex(hwif, d) < 0)
                        return -1;
 
@@ -393,8 +396,6 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
 
                if (ide_allocate_dma_engine(hwif))
                        return -1;
-
-               hwif->dma_ops = &sff_dma_ops;
        }
 
        return 0;
index 8e1ffd57a86df9856f301484ab7c4ab7cc369866..fdb9d70376949514c567ecd6eadba4a8591a095b 100644 (file)
@@ -523,7 +523,6 @@ static const struct ide_tp_ops sgiioc4_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = sgiioc4_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index 652b3a04620ff909e92360b9fddafeb62490d246..cb2b352b876b042277e8ee7a5dcb73b1a40acb3b 100644 (file)
@@ -717,6 +717,7 @@ static const struct ide_dma_ops sil_dma_ops = {
        .dma_test_irq           = siimage_dma_test_irq,
        .dma_timeout            = ide_dma_timeout,
        .dma_lost_irq           = ide_dma_lost_irq,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 #define DECLARE_SII_DEV(p_ops)                         \
index 1ded01d81ab3a663f8ef5bef3c9105367dd9e6c1..48cc748c50438030d2b0e8492fa609fdd3523185 100644 (file)
@@ -299,6 +299,7 @@ static const struct ide_dma_ops sl82c105_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = sl82c105_dma_lost_irq,
        .dma_timeout            = sl82c105_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info sl82c105_chipset __devinitdata = {
index d2c00fb928e43294524eecfa73f12e4a20a02642..84109f5a163228989711b073c7a4b5ffc1e741b9 100644 (file)
@@ -188,6 +188,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = {
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info tc86c001_chipset __devinitdata = {
index 1ac27ac7283b1af3fce46efba45f01d83bb5d78f..882f6f07c4764cdcacb5e3d90c008586897faae2 100644 (file)
@@ -397,6 +397,17 @@ static int tx4939ide_dma_test_irq(ide_drive_t *drive)
        return found;
 }
 
+#ifdef __BIG_ENDIAN
+static u8 tx4939ide_dma_sff_read_status(ide_hwif_t *hwif)
+{
+       void __iomem *base = TX4939IDE_BASE(hwif);
+
+       return tx4939ide_readb(base, TX4939IDE_DMA_Stat);
+}
+#else
+#define tx4939ide_dma_sff_read_status ide_dma_sff_read_status
+#endif
+
 static void tx4939ide_init_hwif(ide_hwif_t *hwif)
 {
        void __iomem *base = TX4939IDE_BASE(hwif);
@@ -443,13 +454,6 @@ static void tx4939ide_tf_load_fixup(ide_drive_t *drive, ide_task_t *task)
 
 #ifdef __BIG_ENDIAN
 
-static u8 tx4939ide_read_sff_dma_status(ide_hwif_t *hwif)
-{
-       void __iomem *base = TX4939IDE_BASE(hwif);
-
-       return tx4939ide_readb(base, TX4939IDE_DMA_Stat);
-}
-
 /* custom iops (independent from SWAP_IO_SPACE) */
 static u8 tx4939ide_inb(unsigned long port)
 {
@@ -585,7 +589,6 @@ static const struct ide_tp_ops tx4939ide_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = tx4939ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
@@ -609,7 +612,6 @@ static const struct ide_tp_ops tx4939ide_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
@@ -638,6 +640,7 @@ static const struct ide_dma_ops tx4939ide_dma_ops = {
        .dma_test_irq           = tx4939ide_dma_test_irq,
        .dma_lost_irq           = ide_dma_lost_irq,
        .dma_timeout            = ide_dma_timeout,
+       .dma_sff_read_status    = tx4939ide_dma_sff_read_status,
 };
 
 static const struct ide_port_info tx4939ide_port_info __initdata = {
index ebc22a836520efb84d11f42d2df0b2b2f65d79dd..3644f632338473b7ad3c77e793454b30320b4d51 100644 (file)
@@ -674,7 +674,6 @@ struct ide_tp_ops {
        void    (*exec_command)(struct hwif_s *, u8);
        u8      (*read_status)(struct hwif_s *);
        u8      (*read_altstatus)(struct hwif_s *);
-       u8      (*read_sff_dma_status)(struct hwif_s *);
 
        void    (*set_irq)(struct hwif_s *, int);
 
@@ -735,6 +734,11 @@ struct ide_dma_ops {
        int     (*dma_test_irq)(struct ide_drive_s *);
        void    (*dma_lost_irq)(struct ide_drive_s *);
        void    (*dma_timeout)(struct ide_drive_s *);
+       /*
+        * The following method is optional and only required to be
+        * implemented for the SFF-8038i compatible controllers.
+        */
+       u8      (*dma_sff_read_status)(struct hwif_s *);
 };
 
 struct ide_host;
@@ -1177,7 +1181,6 @@ void ide_tf_dump(const char *, struct ide_taskfile *);
 void ide_exec_command(ide_hwif_t *, u8);
 u8 ide_read_status(ide_hwif_t *);
 u8 ide_read_altstatus(ide_hwif_t *);
-u8 ide_read_sff_dma_status(ide_hwif_t *);
 
 void ide_set_irq(ide_hwif_t *, int);
 
@@ -1458,6 +1461,7 @@ void ide_dma_exec_cmd(ide_drive_t *, u8);
 extern void ide_dma_start(ide_drive_t *);
 int ide_dma_end(ide_drive_t *);
 int ide_dma_test_irq(ide_drive_t *);
+u8 ide_dma_sff_read_status(ide_hwif_t *);
 extern const struct ide_dma_ops sff_dma_ops;
 #else
 static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }