/* Allocate the data structures needed for using DMA with an interface and fill the proper list of functions pointers  */
static int __devinit pmac_ide_init_dma(ide_hwif_t *, const struct ide_port_info *)
/* Allocate the data structures needed for using DMA with an interface and fill the proper list of functions pointers  */
static int __devinit pmac_ide_init_dma(ide_hwif_t *, const struct ide_port_info *)
{
	pmac_ide_hwif_t *pmif =
		(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
	struct pci_dev *dev = to_pci_dev(hwif->dev);
	if (dev == NULL || pmif->dma_regs == 0)
		return -ENODEV;
	pmif->dma_table_cpu = pci_alloc_consistent(
		dev,
		(MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
		&hwif->dmatable_dma);
	if (pmif->dma_table_cpu == NULL) {
		printk(KERN_ERR "%s: unable to allocate DMA command list\n",
		       hwif->name);
		return -ENOMEM;
	}
	hwif->sg_max_nents = MAX_DCMDS;
	return 0;
}