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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent d54452fb
...@@ -392,6 +392,9 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) ...@@ -392,6 +392,9 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
hwif->mmio = 1; hwif->mmio = 1;
default_hwif_mmiops(hwif); default_hwif_mmiops(hwif);
printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
if (ide_allocate_dma_engine(hwif) == 0)
ide_setup_dma(hwif, mem->start); ide_setup_dma(hwif, mem->start);
idx[0] = i; idx[0] = i;
......
...@@ -841,19 +841,6 @@ EXPORT_SYMBOL_GPL(ide_allocate_dma_engine); ...@@ -841,19 +841,6 @@ EXPORT_SYMBOL_GPL(ide_allocate_dma_engine);
void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
{ {
if (hwif->mmio)
printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
else
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
hwif->name, base, base + 7);
hwif->extra_base = base + (hwif->channel ? 8 : 16);
if (ide_allocate_dma_engine(hwif)) {
ide_release_dma_engine(hwif);
return;
}
hwif->dma_base = base; hwif->dma_base = base;
if (!hwif->dma_command) if (!hwif->dma_command)
......
...@@ -367,15 +367,24 @@ void ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d) ...@@ -367,15 +367,24 @@ void ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
if ((d->host_flags & IDE_HFLAG_NO_AUTODMA) == 0 || if ((d->host_flags & IDE_HFLAG_NO_AUTODMA) == 0 ||
((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE &&
(dev->class & 0x80))) { (dev->class & 0x80))) {
unsigned long dma_base = ide_get_or_set_dma_base(d, hwif); unsigned long base = ide_get_or_set_dma_base(d, hwif);
if (dma_base == 0 || ide_pci_set_master(dev, d->name) < 0) if (base == 0 || ide_pci_set_master(dev, d->name) < 0)
goto out_disabled; goto out_disabled;
if (d->init_dma) if (d->init_dma)
d->init_dma(hwif, dma_base); d->init_dma(hwif, base);
ide_setup_dma(hwif, dma_base); if (hwif->mmio)
printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
else
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
hwif->name, base, base + 7);
hwif->extra_base = base + (hwif->channel ? 8 : 16);
if (ide_allocate_dma_engine(hwif) == 0)
ide_setup_dma(hwif, base);
} }
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment