From 75b1d97535327d0428c6bffd9d5407e65546fd5d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 9 Jul 2007 23:17:57 +0200 Subject: ide: convert ide_find_best_mode() users to use ide_max_dma_mode() ide-timing.h: * remove handling of DMA modes from ide_find_best_mode() and rename it to ide_find_best_pio_mode() * drop no longer needed "map" argument from ide_find_best_pio_mode() and delete needless ->id check * remove no longer needed XFER_SWDMA and XFER_UDMA* defines au1xxx-ide.c: * use ide_max_dma_mode() instead of ide_find_best_mode() * remove needless CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA #ifdef amd74xx.c: * store UDMA masks in amd_ide_chip[] and while at it make "base" field to be u8 instead of unsigned long * convert the driver to use UDMA masks from amd_ide_chip[] * use ide_max_dma_mode() and ide_find_best_pio_mode() instead of ide_find_best_mode() * delete stale comment from amd74xx_ide_dma_check() * remove no longer needed AMD_UDMA* defines via82cxxx.c: * remove unused DISPLAY_VIA_TIMINGS define * store UDMA masks in via_isa_bridges[] and while at it make "flags" field to be u8 instead of u16 * convert the driver to use UDMA masks from via_isa_bridges[] * use ide_max_dma_mode() and ide_find_best_pio_mode() instead of ide_find_best_mode() * remove no longer needed VIA_UDMA* defines pmac.c: * use ide_max_dma_mode() instead of ide_find_best_mode() There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sergei Shtylyov --- drivers/ide/ppc/pmac.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'drivers/ide/ppc') diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index f9bada093d1..5e307740945 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -1821,28 +1821,11 @@ pmac_ide_dma_check(ide_drive_t *drive) enable = 0; if (enable) { - short mode; - - map = XFER_MWDMA; - if (pmif->kind == controller_kl_ata4 - || pmif->kind == controller_un_ata6 - || pmif->kind == controller_k2_ata6 - || pmif->kind == controller_sh_ata6) { - map |= XFER_UDMA; - if (pmif->cable_80) { - map |= XFER_UDMA_66; - if (pmif->kind == controller_un_ata6 || - pmif->kind == controller_k2_ata6 || - pmif->kind == controller_sh_ata6) - map |= XFER_UDMA_100; - if (pmif->kind == controller_sh_ata6) - map |= XFER_UDMA_133; - } - } - mode = ide_find_best_mode(drive, map); - if (mode & XFER_UDMA) + u8 mode = ide_max_dma_mode(drive); + + if (mode >= XFER_UDMA_0) drive->using_dma = pmac_ide_udma_enable(drive, mode); - else if (mode & XFER_MWDMA) + else if (mode >= XFER_MW_DMA_0) drive->using_dma = pmac_ide_mdma_enable(drive, mode); hwif->OUTB(0, IDE_CONTROL_REG); /* Apply settings to controller */ -- cgit v1.2.3