ide: export ide_allocate_dma_engine()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)
Export ide_allocate_dma_engine() and use it in trm290 host driver.

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

index 1933254660a1df96da7332f467887471cc2d3b22..ca7f974a71f5a8644215067384bc667d167c56d9 100644 (file)
@@ -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)
 {
index 0677ab016ef8b2f87567fffbb9239e0ece73d6f6..7e354d33323b6652c14410fe7940122b7284bd5f 100644 (file)
@@ -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 */
index 989fe78b354f787e503d7cd4b89d527447a2d6bd..b8a9d3b4d633bed13fc8e3537b6c5e400dc15f52 100644 (file)
@@ -1155,7 +1155,8 @@ void ide_destroy_dmatable(ide_drive_t *);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 extern int ide_build_dmatable(ide_drive_t *, struct request *);
-extern void ide_release_dma_engine(ide_hwif_t *);
+int ide_allocate_dma_engine(ide_hwif_t *);
+void ide_release_dma_engine(ide_hwif_t *);
 extern void ide_setup_dma(ide_hwif_t *, unsigned long);
 
 void ide_dma_host_set(ide_drive_t *, int);