/* Set up the DMA functionality on the ALi 15x3.  */
static int __devinit init_dma_ali15x3(ide_hwif_t *hwif, const struct ide_port_info *d)
/* Set up the DMA functionality on the ALi 15x3.  */
static int __devinit init_dma_ali15x3(ide_hwif_t *hwif, const struct ide_port_info *d)
{
	struct pci_dev *dev = to_pci_dev(hwif->dev);
	unsigned long base = ide_pci_dma_base(hwif, d);
	if (base == 0)
		return -1;
	hwif->dma_base = base;
	if (ide_pci_check_simplex(hwif, d) < 0)
		return -1;
	if (ide_pci_set_master(dev, d->name) < 0)
		return -1;
	if (!hwif->channel)
		outb(inb(base + 2) & 0x60, base + 2);
	printk(KERN_INFO "    %s: BM-DMA at 0x%04lx-0x%04lx\n",
			 hwif->name, base, base + 7);
	if (ide_allocate_dma_engine(hwif))
		return -1;
	return 0;
}