/* After a DMA transfer, make sure the controller is stopped  */
static int pmac_ide_dma_end(ide_drive_t *drive)
/* After a DMA transfer, make sure the controller is stopped  */
static int pmac_ide_dma_end(ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;
	pmac_ide_hwif_t *pmif =
		(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
	volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
	u32 dstat;
	dstat = readl(&dma->status);
	writel(((RUN|WAKE|DEAD) << 16), &dma->control);
	return (dstat & (RUN|DEAD)) != RUN;
}