X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fide%2Fpci%2Ftriflex.c;h=b13cce1fd1a6aa7e973b5e7d621d2af33a6984c1;hb=a2f44b27303a5353859d77a3e96a1d3f33f56ab7;hp=eca0772f22e68d4a9b5ef9e3eff92c5e3f3fb3ae;hpb=ec9397bab20a628530ce3051167d3d0fcc2c1af7;p=linux-2.6.git diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index eca0772f2..b13cce1fd 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -27,7 +27,6 @@ * Not publically available. */ -#include #include #include #include @@ -118,28 +117,19 @@ 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) +static void __devinit init_hwif_triflex(ide_hwif_t *hwif) { hwif->tuneproc = &triflex_tune_drive; hwif->speedproc = &triflex_tune_chipset; @@ -167,9 +157,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[] = { @@ -185,7 +173,7 @@ static struct pci_driver driver = { .probe = triflex_init_one, }; -static int triflex_ide_init(void) +static int __init triflex_ide_init(void) { return ide_pci_register_driver(&driver); }