aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:21 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:21 -0400
commit63158d5c217e2e62665ae9b10d203bd7da817108 (patch)
treedc98e5f2b66d26f6aeb8405e8c47ea49ea784f1a
parentd54452fbf84500eff77a55a2061f4669441d2cc3 (diff)
ide: cleanup ide_setup_dma()
* There is no need to call ide_release_dma_engine(). * Move the code up to (and including) ide_allocate_dma_engine() call to the callers of ide_setup_dma(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/arm/palm_bk3710.c5
-rw-r--r--drivers/ide/ide-dma.c13
-rw-r--r--drivers/ide/setup-pci.c17
3 files changed, 17 insertions, 18 deletions
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 9e21b8e6099c..7ed79e7f3110 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -392,7 +392,10 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
392 hwif->mmio = 1; 392 hwif->mmio = 1;
393 default_hwif_mmiops(hwif); 393 default_hwif_mmiops(hwif);
394 394
395 ide_setup_dma(hwif, mem->start); 395 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
396
397 if (ide_allocate_dma_engine(hwif) == 0)
398 ide_setup_dma(hwif, mem->start);
396 399
397 idx[0] = i; 400 idx[0] = i;
398 401
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ca7f974a71f5..366bbc841fc9 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -841,19 +841,6 @@ EXPORT_SYMBOL_GPL(ide_allocate_dma_engine);
841 841
842void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) 842void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
843{ 843{
844 if (hwif->mmio)
845 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
846 else
847 printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
848 hwif->name, base, base + 7);
849
850 hwif->extra_base = base + (hwif->channel ? 8 : 16);
851
852 if (ide_allocate_dma_engine(hwif)) {
853 ide_release_dma_engine(hwif);
854 return;
855 }
856
857 hwif->dma_base = base; 844 hwif->dma_base = base;
858 845
859 if (!hwif->dma_command) 846 if (!hwif->dma_command)
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index bf28970b0278..5006ea98733b 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -367,15 +367,24 @@ void ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
367 if ((d->host_flags & IDE_HFLAG_NO_AUTODMA) == 0 || 367 if ((d->host_flags & IDE_HFLAG_NO_AUTODMA) == 0 ||
368 ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && 368 ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE &&
369 (dev->class & 0x80))) { 369 (dev->class & 0x80))) {
370 unsigned long dma_base = ide_get_or_set_dma_base(d, hwif); 370 unsigned long base = ide_get_or_set_dma_base(d, hwif);
371 371
372 if (dma_base == 0 || ide_pci_set_master(dev, d->name) < 0) 372 if (base == 0 || ide_pci_set_master(dev, d->name) < 0)
373 goto out_disabled; 373 goto out_disabled;
374 374
375 if (d->init_dma) 375 if (d->init_dma)
376 d->init_dma(hwif, dma_base); 376 d->init_dma(hwif, base);
377 377
378 ide_setup_dma(hwif, dma_base); 378 if (hwif->mmio)
379 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
380 else
381 printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
382 hwif->name, base, base + 7);
383
384 hwif->extra_base = base + (hwif->channel ? 8 : 16);
385
386 if (ide_allocate_dma_engine(hwif) == 0)
387 ide_setup_dma(hwif, base);
379 } 388 }
380 389
381 return; 390 return;