From b8e73fba60414e161d8fd2429b6fb268e34502e2 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Apr 2008 22:25:21 +0200 Subject: ide: export ide_allocate_dma_engine() Export ide_allocate_dma_engine() and use it in trm290 host driver. Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-dma.c | 3 ++- drivers/ide/pci/trm290.c | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 1933254660a1..ca7f974a71f5 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -821,7 +821,7 @@ void ide_release_dma_engine(ide_hwif_t *hwif) } } -static int ide_allocate_dma_engine(ide_hwif_t *hwif) +int ide_allocate_dma_engine(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); @@ -837,6 +837,7 @@ static int ide_allocate_dma_engine(ide_hwif_t *hwif) return 1; } +EXPORT_SYMBOL_GPL(ide_allocate_dma_engine); void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) { diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index 0677ab016ef8..7e354d33323b 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c @@ -254,16 +254,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) hwif->config_data = cfg_base; hwif->dma_base = (cfg_base + 4) ^ (hwif->channel ? 0x80 : 0); - printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", + printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, hwif->dma_base, hwif->dma_base + 3); - hwif->dmatable_cpu = pci_alloc_consistent(dev, PRD_ENTRIES * PRD_BYTES, - &hwif->dmatable_dma); - if (!hwif->dmatable_cpu) { - printk(KERN_CONT " -- Error, unable to allocate DMA table.\n"); + if (ide_allocate_dma_engine(hwif)) return; - } - printk(KERN_CONT "\n"); local_irq_save(flags); /* put config reg into first byte of hwif->select_data */ -- cgit v1.2.2