ide: export ide_allocate_dma_engine()

Export ide_allocate_dma_engine() and use it in trm290 host driver.
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 23658f8a
...@@ -821,7 +821,7 @@ void ide_release_dma_engine(ide_hwif_t *hwif) ...@@ -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); struct pci_dev *pdev = to_pci_dev(hwif->dev);
...@@ -837,6 +837,7 @@ static int ide_allocate_dma_engine(ide_hwif_t *hwif) ...@@ -837,6 +837,7 @@ static int ide_allocate_dma_engine(ide_hwif_t *hwif)
return 1; return 1;
} }
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)
{ {
......
...@@ -254,16 +254,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) ...@@ -254,16 +254,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
hwif->config_data = cfg_base; hwif->config_data = cfg_base;
hwif->dma_base = (cfg_base + 4) ^ (hwif->channel ? 0x80 : 0); 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->name, hwif->dma_base, hwif->dma_base + 3);
hwif->dmatable_cpu = pci_alloc_consistent(dev, PRD_ENTRIES * PRD_BYTES, if (ide_allocate_dma_engine(hwif))
&hwif->dmatable_dma);
if (!hwif->dmatable_cpu) {
printk(KERN_CONT " -- Error, unable to allocate DMA table.\n");
return; return;
}
printk(KERN_CONT "\n");
local_irq_save(flags); local_irq_save(flags);
/* put config reg into first byte of hwif->select_data */ /* put config reg into first byte of hwif->select_data */
......
...@@ -1155,7 +1155,8 @@ void ide_destroy_dmatable(ide_drive_t *); ...@@ -1155,7 +1155,8 @@ void ide_destroy_dmatable(ide_drive_t *);
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF #ifdef CONFIG_BLK_DEV_IDEDMA_SFF
extern int ide_build_dmatable(ide_drive_t *, struct request *); 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); extern void ide_setup_dma(ide_hwif_t *, unsigned long);
void ide_dma_host_set(ide_drive_t *, int); void ide_dma_host_set(ide_drive_t *, int);
......
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