]> err.no Git - linux-2.6/commitdiff
[PATCH] ide: remove dma_base2 field from ide_hwif_t
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Tue, 3 Oct 2006 08:14:25 +0000 (01:14 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 3 Oct 2006 15:04:08 +0000 (08:04 -0700)
Remove dma_base2 field from ide_hwif_t as it's used only in 2 drivers and
without great need.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: John Keller <jpk@sgi.com>
Signed-off-by: Jeremy Higdon <jeremy@sgi.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/ide/ide-dma.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
include/linux/ide.h

index 9069766f236eafe74ef9f71da8a27e55b07b7903..56efed6742d4d32945a1072203fea57b833d1df5 100644 (file)
@@ -799,8 +799,6 @@ static int ide_release_iomio_dma(ide_hwif_t *hwif)
        release_region(hwif->dma_base, 8);
        if (hwif->extra_ports)
                release_region(hwif->extra_base, hwif->extra_ports);
-       if (hwif->dma_base2)
-               release_region(hwif->dma_base, 8);
        return 1;
 }
 
@@ -872,19 +870,9 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
        }
 
        if(hwif->mate)
-               hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
+               hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base:base;
        else
                hwif->dma_master = base;
-       if (hwif->dma_base2) {
-               if (!request_region(hwif->dma_base2, ports, hwif->name))
-               {
-                       printk(" -- Error, secondary ports in use.\n");
-                       release_region(base, ports);
-                       if (hwif->extra_ports)
-                               release_region(hwif->extra_base, hwif->extra_ports);
-                       return 1;
-               }
-       }
        return 0;
 }
 
index d8a0d87df734bb22f383b540b5291991ffef99fa..f3fe287fbd89ba6b5d65deb92b42ba1ca9f875e2 100644 (file)
@@ -220,7 +220,7 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
        ide_hwif_t *hwif = HWIF(drive);
        u64 dma_base = hwif->dma_base;
        int dma_stat = 0;
-       unsigned long *ending_dma = (unsigned long *) hwif->dma_base2;
+       unsigned long *ending_dma = ide_get_hwifdata(hwif);
 
        hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4);
 
@@ -369,6 +369,7 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
 {
        void __iomem *virt_dma_base;
        int num_ports = sizeof (ioc4_dma_regs_t);
+       void *pad;
 
        printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name,
               dma_base, dma_base + num_ports - 1);
@@ -400,17 +401,14 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
 
        hwif->sg_max_nents = IOC4_PRD_ENTRIES;
 
-       hwif->dma_base2 = (unsigned long)
-               pci_alloc_consistent(hwif->pci_dev,
-                                    IOC4_IDE_CACHELINE_SIZE,
-                                    (dma_addr_t *) &(hwif->dma_status));
+       pad = pci_alloc_consistent(hwif->pci_dev, IOC4_IDE_CACHELINE_SIZE,
+                                  (dma_addr_t *) &(hwif->dma_status));
 
-       if (!hwif->dma_base2)
-               goto dma_base2alloc_failure;
-
-       return;
+       if (pad) {
+               ide_set_hwifdata(hwif, pad);
+               return;
+       }
 
-dma_base2alloc_failure:
        pci_free_consistent(hwif->pci_dev,
                            IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
                            hwif->dmatable_cpu, hwif->dmatable_dma);
@@ -476,7 +474,7 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
        hwif->OUTL(dma_addr, dma_base + IOC4_DMA_PTR_L * 4);
 
        /* Address of the Ending DMA */
-       memset((unsigned int *) hwif->dma_base2, 0, IOC4_IDE_CACHELINE_SIZE);
+       memset(ide_get_hwifdata(hwif), 0, IOC4_IDE_CACHELINE_SIZE);
        ending_dma_addr = cpu_to_le32(hwif->dma_status);
        hwif->OUTL(ending_dma_addr, dma_base + IOC4_DMA_END_ADDR * 4);
 
index 20b392948f366ac9a5767f2226eb5f2d44f7be52..697f566fb90ae02b87c44d47a62b3ac6dc8f0d48 100644 (file)
@@ -898,7 +898,6 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
                base = (unsigned long) addr;
 
        hwif->dma_base                  = base + (ch ? 0x08 : 0x00);
-       hwif->dma_base2                 = base + (ch ? 0x18 : 0x10);
        hwif->mmio                      = 2;
 }
 
index 097d16e5ab37b24764fea772057bdef04bcef9bd..a9a9e33e448f13065c6a6856f5823ad6e67a53e7 100644 (file)
@@ -774,7 +774,6 @@ typedef struct hwif_s {
        unsigned long   dma_status;     /* dma status register */
        unsigned long   dma_vendor3;    /* dma vendor 3 register */
        unsigned long   dma_prdtable;   /* actual prd table address */
-       unsigned long   dma_base2;      /* extended base addr for dma ports */
 
        unsigned long   config_data;    /* for use by chipset-specific code */
        unsigned long   select_data;    /* for use by chipset-specific code */