X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fide%2Fpci%2Ftriflex.c;h=a1df2bfe3631cbe5136bbff562727044550ae54b;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=eca0772f22e68d4a9b5ef9e3eff92c5e3f3fb3ae;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index eca0772f2..a1df2bfe3 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -118,25 +118,16 @@ static int triflex_config_drive_xfer_rate(ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); struct hd_driveid *id = drive->id; - - if (id && (id->capability & 1) && drive->autodma) { - if (__ide_dma_bad_drive(drive)) - goto tune_pio; - if (id->field_valid & 2) { - if ((id->dma_mword & hwif->mwdma_mask) || - (id->dma_1word & hwif->swdma_mask)) { - if (!triflex_config_drive_for_dma(drive)) - goto tune_pio; - } - } else - goto tune_pio; - } else { -tune_pio: - hwif->tuneproc(drive, 255); - return hwif->ide_dma_off_quietly(drive); + + if ((id->capability & 1) && drive->autodma) { + if (ide_use_dma(drive)) { + if (triflex_config_drive_for_dma(drive)) + return hwif->ide_dma_on(drive); + } } - return hwif->ide_dma_on(drive); + hwif->tuneproc(drive, 255); + return hwif->ide_dma_off_quietly(drive); } static void __init init_hwif_triflex(ide_hwif_t *hwif) @@ -167,9 +158,7 @@ static ide_pci_device_t triflex_device __devinitdata = { static int __devinit triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id) { - ide_setup_pci_device(dev, &triflex_device); - - return 0; + return ide_setup_pci_device(dev, &triflex_device); } static struct pci_device_id triflex_pci_tbl[] = {