]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: ide_setup_dma() assumes 8 ports
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 1 Feb 2008 22:09:30 +0000 (23:09 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 1 Feb 2008 22:09:30 +0000 (23:09 +0100)
According to http://marc.info/?l=linux-ide&m=114346138611631, the drivers must
always register 8 DMA ports with ide_setup_dma(), so its last argument is not
needed. While at it, kill some useless parens in that function...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-dma.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/setup-pci.c
include/linux/ide.h

index 8d668a80adb3b25240da1ddbd79110d65c4553a6..51c86bc241ac710fa0e0005ab33a3494f0ac609a 100644 (file)
@@ -889,19 +889,19 @@ static int ide_allocate_dma_engine(ide_hwif_t *hwif)
        return 1;
 }
 
-static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
+static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base)
 {
        printk(KERN_INFO "    %s: MMIO-DMA ", hwif->name);
 
        return 0;
 }
 
-static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
+static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base)
 {
        printk(KERN_INFO "    %s: BM-DMA at 0x%04lx-0x%04lx",
-              hwif->name, base, base + ports - 1);
+              hwif->name, base, base + 7);
 
-       if (!request_region(base, ports, hwif->name)) {
+       if (!request_region(base, 8, hwif->name)) {
                printk(" -- Error, ports in use.\n");
                return 1;
        }
@@ -913,7 +913,7 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
                        if (!request_region(hwif->extra_base,
                                            hwif->cds->extra, hwif->cds->name)) {
                                printk(" -- Error, extra ports in use.\n");
-                               release_region(base, ports);
+                               release_region(base, 8);
                                return 1;
                        }
                        hwif->extra_ports = hwif->cds->extra;
@@ -923,19 +923,19 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
        return 0;
 }
 
-static int ide_dma_iobase(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
+static int ide_dma_iobase(ide_hwif_t *hwif, unsigned long base)
 {
        if (hwif->mmio)
-               return ide_mapped_mmio_dma(hwif, base,ports);
+               return ide_mapped_mmio_dma(hwif, base);
 
-       return ide_iomio_dma(hwif, base, ports);
+       return ide_iomio_dma(hwif, base);
 }
 
-void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
+void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
 {
        u8 dma_stat;
 
-       if (ide_dma_iobase(hwif, base, num_ports))
+       if (ide_dma_iobase(hwif, base))
                return;
 
        if (ide_allocate_dma_engine(hwif)) {
@@ -945,16 +945,16 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
 
        hwif->dma_base = base;
 
-       if (!(hwif->dma_command))
-               hwif->dma_command       = hwif->dma_base;
-       if (!(hwif->dma_vendor1))
-               hwif->dma_vendor1       = (hwif->dma_base + 1);
-       if (!(hwif->dma_status))
-               hwif->dma_status        = (hwif->dma_base + 2);
-       if (!(hwif->dma_vendor3))
-               hwif->dma_vendor3       = (hwif->dma_base + 3);
-       if (!(hwif->dma_prdtable))
-               hwif->dma_prdtable      = (hwif->dma_base + 4);
+       if (!hwif->dma_command)
+               hwif->dma_command       = hwif->dma_base + 0;
+       if (!hwif->dma_vendor1)
+               hwif->dma_vendor1       = hwif->dma_base + 1;
+       if (!hwif->dma_status)
+               hwif->dma_status        = hwif->dma_base + 2;
+       if (!hwif->dma_vendor3)
+               hwif->dma_vendor3       = hwif->dma_base + 3;
+       if (!hwif->dma_prdtable)
+               hwif->dma_prdtable      = hwif->dma_base + 4;
 
        if (!hwif->dma_host_set)
                hwif->dma_host_set = &ide_dma_host_set;
index 49aa82e412b6ed1da3fb40b3d2291501a92b232a..9dd7cb4d07d42efa538e2be706e0e74e4bb6b843 100644 (file)
@@ -745,7 +745,7 @@ static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
                return;
        if (!hwif->channel)
                outb(inb(dmabase + 2) & 0x60, dmabase + 2);
-       ide_setup_dma(hwif, dmabase, 8);
+       ide_setup_dma(hwif, dmabase);
 }
 
 static const struct ide_port_info ali15x3_chipset __devinitdata = {
index 12685939a813f61f0e30521d2b871f2dd9fb9b1d..d33a3f9c12b75fe43928f04519d58e8b8deb37e8 100644 (file)
@@ -1413,7 +1413,7 @@ static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
 
        local_irq_restore(flags);
 
-       ide_setup_dma(hwif, dmabase, 8);
+       ide_setup_dma(hwif, dmabase);
 }
 
 static void __devinit hpt374_init(struct pci_dev *dev, struct pci_dev *dev2)
index 3a1e081fe3901c06e70dbaf7054238f28e90e10f..ea66383c557925972c5b97754dfeec0561a8c5c4 100644 (file)
@@ -334,7 +334,7 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
        u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0;
 
        if (hwif->channel) {
-               ide_setup_dma(hwif, dmabase, 8);
+               ide_setup_dma(hwif, dmabase);
                return;
        }
 
@@ -358,7 +358,7 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
        }
 #endif /* CONFIG_PDC202XX_BURST */
 
-       ide_setup_dma(hwif, dmabase, 8);
+       ide_setup_dma(hwif, dmabase);
 }
 
 static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
index 676c66e728818aac177442847d50b1d73413ef6e..c473f45abd33ed9f3762ed1ba3af0279a2d0e906 100644 (file)
@@ -451,7 +451,7 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, const struct ide_port_info *
                        if (d->init_dma) {
                                d->init_dma(hwif, dma_base);
                        } else {
-                               ide_setup_dma(hwif, dma_base, 8);
+                               ide_setup_dma(hwif, dma_base);
                        }
                } else {
                        printk(KERN_INFO "%s: %s Bus-Master DMA disabled "
index 34542186fb15d13b75e4cd881782b8f06fdf035a..f1a10c8380bdffa0694d7ecc1ab56bec6e19ecc8 100644 (file)
@@ -1155,7 +1155,7 @@ extern int ide_build_sglist(ide_drive_t *, struct request *);
 extern int ide_build_dmatable(ide_drive_t *, struct request *);
 extern void ide_destroy_dmatable(ide_drive_t *);
 extern int ide_release_dma(ide_hwif_t *);
-extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int);
+extern void ide_setup_dma(ide_hwif_t *, unsigned long);
 
 void ide_dma_host_set(ide_drive_t *, int);
 extern int ide_dma_setup(ide_drive_t *);