aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:25 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:25 -0500
commit7569e8dc2213ecc47024ea5edbadc8736487d926 (patch)
tree44c47e85b5e87c75972c077da31f198c4f597688 /drivers/ide/pci
parent056a697b7388844a1341e92e277bff8e5bf61ec9 (diff)
ide: add ide_use_fast_pio() helper (v3)
* add ide_use_fast_pio() helper for use by host drivers * add DMA capability and hwif->autodma checks to ide_use_dma() - au1xxx-ide/it8213/it821x drivers didn't check for (id->capability & 1) [ for the IT8211/2 in SMART mode this check shouldn't be made but since in it821x_fixups() we set DMA bit explicitly: if(strstr(id->model, "Integrated Technology Express")) { /* In raid mode the ident block is slightly buggy We need to set the bits so that the IDE layer knows LBA28. LBA48 and DMA ar valid */ id->capability |= 3; /* LBA28, DMA */ we are better off using generic helper if we can ] - ide-cris driver didn't set ->autodma [ before the patch hwif->autodma was only checked in the chipset specific hwif->ide_dma_check implementations, for ide-cris it is cris_dma_check() function so there no behavior change here ] v2: * updated patch description (thanks to Alan Cox for the feedback) v3: * updated for scc_pata driver Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/aec62xx.c14
-rw-r--r--drivers/ide/pci/atiixp.c14
-rw-r--r--drivers/ide/pci/cmd64x.c14
-rw-r--r--drivers/ide/pci/cs5535.c13
-rw-r--r--drivers/ide/pci/hpt34x.c16
-rw-r--r--drivers/ide/pci/hpt366.c11
-rw-r--r--drivers/ide/pci/pdc202xx_new.c12
-rw-r--r--drivers/ide/pci/pdc202xx_old.c14
-rw-r--r--drivers/ide/pci/piix.c12
-rw-r--r--drivers/ide/pci/serverworks.c14
-rw-r--r--drivers/ide/pci/siimage.c14
-rw-r--r--drivers/ide/pci/sis5513.c14
-rw-r--r--drivers/ide/pci/slc90e66.c12
-rw-r--r--drivers/ide/pci/tc86c001.c12
-rw-r--r--drivers/ide/pci/triflex.c9
15 files changed, 45 insertions, 150 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index cac12c38b940..199507391ae8 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -210,19 +210,11 @@ static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
210static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) 210static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
211{ 211{
212 ide_hwif_t *hwif = HWIF(drive); 212 ide_hwif_t *hwif = HWIF(drive);
213 struct hd_driveid *id = drive->id;
214 213
215 if ((id->capability & 1) && drive->autodma) { 214 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
215 return hwif->ide_dma_on(drive);
216 216
217 if (ide_use_dma(drive)) { 217 if (ide_use_fast_pio(drive)) {
218 if (config_chipset_for_dma(drive))
219 return hwif->ide_dma_on(drive);
220 }
221
222 goto fast_ata_pio;
223
224 } else if ((id->capability & 8) || (id->field_valid & 2)) {
225fast_ata_pio:
226 aec62xx_tune_drive(drive, 5); 218 aec62xx_tune_drive(drive, 5);
227 return hwif->ide_dma_off_quietly(drive); 219 return hwif->ide_dma_off_quietly(drive);
228 } 220 }
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 922b315da4a0..dfc738c42228 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -253,22 +253,14 @@ static int atiixp_config_drive_for_dma(ide_drive_t *drive)
253static int atiixp_dma_check(ide_drive_t *drive) 253static int atiixp_dma_check(ide_drive_t *drive)
254{ 254{
255 ide_hwif_t *hwif = HWIF(drive); 255 ide_hwif_t *hwif = HWIF(drive);
256 struct hd_driveid *id = drive->id;
257 u8 tspeed, speed; 256 u8 tspeed, speed;
258 257
259 drive->init_speed = 0; 258 drive->init_speed = 0;
260 259
261 if ((id->capability & 1) && drive->autodma) { 260 if (ide_use_dma(drive) && atiixp_config_drive_for_dma(drive))
261 return hwif->ide_dma_on(drive);
262 262
263 if (ide_use_dma(drive)) { 263 if (ide_use_fast_pio(drive)) {
264 if (atiixp_config_drive_for_dma(drive))
265 return hwif->ide_dma_on(drive);
266 }
267
268 goto fast_ata_pio;
269
270 } else if ((id->capability & 8) || (id->field_valid & 2)) {
271fast_ata_pio:
272 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); 264 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
273 speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0; 265 speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
274 hwif->speedproc(drive, speed); 266 hwif->speedproc(drive, speed);
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 009fc9168443..b1f9f5f3615e 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -475,19 +475,11 @@ static int config_chipset_for_dma (ide_drive_t *drive)
475static int cmd64x_config_drive_for_dma (ide_drive_t *drive) 475static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
476{ 476{
477 ide_hwif_t *hwif = HWIF(drive); 477 ide_hwif_t *hwif = HWIF(drive);
478 struct hd_driveid *id = drive->id;
479 478
480 if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) { 479 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
480 return hwif->ide_dma_on(drive);
481 481
482 if (ide_use_dma(drive)) { 482 if (ide_use_fast_pio(drive)) {
483 if (config_chipset_for_dma(drive))
484 return hwif->ide_dma_on(drive);
485 }
486
487 goto fast_ata_pio;
488
489 } else if ((id->capability & 8) || (id->field_valid & 2)) {
490fast_ata_pio:
491 config_chipset_for_pio(drive, 1); 483 config_chipset_for_pio(drive, 1);
492 return hwif->ide_dma_off_quietly(drive); 484 return hwif->ide_dma_off_quietly(drive);
493 } 485 }
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 5c5aec28e671..e47653f4d1dd 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -196,21 +196,14 @@ static int cs5535_config_drive_for_dma(ide_drive_t *drive)
196static int cs5535_dma_check(ide_drive_t *drive) 196static int cs5535_dma_check(ide_drive_t *drive)
197{ 197{
198 ide_hwif_t *hwif = drive->hwif; 198 ide_hwif_t *hwif = drive->hwif;
199 struct hd_driveid *id = drive->id;
200 u8 speed; 199 u8 speed;
201 200
202 drive->init_speed = 0; 201 drive->init_speed = 0;
203 202
204 if ((id->capability & 1) && drive->autodma) { 203 if (ide_use_dma(drive) && cs5535_config_drive_for_dma(drive))
205 if (ide_use_dma(drive)) { 204 return hwif->ide_dma_on(drive);
206 if (cs5535_config_drive_for_dma(drive))
207 return hwif->ide_dma_on(drive);
208 }
209
210 goto fast_ata_pio;
211 205
212 } else if ((id->capability & 8) || (id->field_valid & 2)) { 206 if (ide_use_fast_pio(drive)) {
213fast_ata_pio:
214 speed = ide_get_best_pio_mode(drive, 255, 4, NULL); 207 speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
215 cs5535_set_drive(drive, speed); 208 cs5535_set_drive(drive, speed);
216 return hwif->ide_dma_off_quietly(drive); 209 return hwif->ide_dma_off_quietly(drive);
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 0de3b61cabe3..0830089c77fd 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -110,25 +110,17 @@ static int config_chipset_for_dma (ide_drive_t *drive)
110static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) 110static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
111{ 111{
112 ide_hwif_t *hwif = HWIF(drive); 112 ide_hwif_t *hwif = HWIF(drive);
113 struct hd_driveid *id = drive->id;
114 113
115 drive->init_speed = 0; 114 drive->init_speed = 0;
116 115
117 if (id && (id->capability & 1) && drive->autodma) { 116 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
118
119 if (ide_use_dma(drive)) {
120 if (config_chipset_for_dma(drive))
121#ifndef CONFIG_HPT34X_AUTODMA 117#ifndef CONFIG_HPT34X_AUTODMA
122 return hwif->ide_dma_off_quietly(drive); 118 return hwif->ide_dma_off_quietly(drive);
123#else 119#else
124 return hwif->ide_dma_on(drive); 120 return hwif->ide_dma_on(drive);
125#endif 121#endif
126 }
127
128 goto fast_ata_pio;
129 122
130 } else if ((id->capability & 8) || (id->field_valid & 2)) { 123 if (ide_use_fast_pio(drive)) {
131fast_ata_pio:
132 hpt34x_tune_drive(drive, 255); 124 hpt34x_tune_drive(drive, 255);
133 return hwif->ide_dma_off_quietly(drive); 125 return hwif->ide_dma_off_quietly(drive);
134 } 126 }
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 06dce0999105..d3f6f9da96b2 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -737,18 +737,13 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
737static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) 737static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
738{ 738{
739 ide_hwif_t *hwif = HWIF(drive); 739 ide_hwif_t *hwif = HWIF(drive);
740 struct hd_driveid *id = drive->id;
741 740
742 drive->init_speed = 0; 741 drive->init_speed = 0;
743 742
744 if ((id->capability & 1) && drive->autodma) { 743 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
745 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 744 return hwif->ide_dma_on(drive);
746 return hwif->ide_dma_on(drive);
747
748 goto fast_ata_pio;
749 745
750 } else if ((id->capability & 8) || (id->field_valid & 2)) { 746 if (ide_use_fast_pio(drive)) {
751fast_ata_pio:
752 hpt3xx_tune_drive(drive, 255); 747 hpt3xx_tune_drive(drive, 255);
753 return hwif->ide_dma_off_quietly(drive); 748 return hwif->ide_dma_off_quietly(drive);
754 } 749 }
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 236a03144a27..b13a06c5cb2d 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -282,19 +282,13 @@ static int config_chipset_for_dma(ide_drive_t *drive)
282static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive) 282static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
283{ 283{
284 ide_hwif_t *hwif = HWIF(drive); 284 ide_hwif_t *hwif = HWIF(drive);
285 struct hd_driveid *id = drive->id;
286 285
287 drive->init_speed = 0; 286 drive->init_speed = 0;
288 287
289 if ((id->capability & 1) && drive->autodma) { 288 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
290 289 return hwif->ide_dma_on(drive);
291 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
292 return hwif->ide_dma_on(drive);
293
294 goto fast_ata_pio;
295 290
296 } else if ((id->capability & 8) || (id->field_valid & 2)) { 291 if (ide_use_fast_pio(drive)) {
297fast_ata_pio:
298 hwif->tuneproc(drive, 255); 292 hwif->tuneproc(drive, 255);
299 return hwif->ide_dma_off_quietly(drive); 293 return hwif->ide_dma_off_quietly(drive);
300 } 294 }
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 80eb6d271330..a2be3d2fd3f6 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -323,21 +323,13 @@ chipset_is_set:
323static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) 323static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
324{ 324{
325 ide_hwif_t *hwif = HWIF(drive); 325 ide_hwif_t *hwif = HWIF(drive);
326 struct hd_driveid *id = drive->id;
327 326
328 drive->init_speed = 0; 327 drive->init_speed = 0;
329 328
330 if (id && (id->capability & 1) && drive->autodma) { 329 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
331 330 return hwif->ide_dma_on(drive);
332 if (ide_use_dma(drive)) {
333 if (config_chipset_for_dma(drive))
334 return hwif->ide_dma_on(drive);
335 }
336
337 goto fast_ata_pio;
338 331
339 } else if ((id->capability & 8) || (id->field_valid & 2)) { 332 if (ide_use_fast_pio(drive)) {
340fast_ata_pio:
341 pdc202xx_tune_drive(drive, 255); 333 pdc202xx_tune_drive(drive, 255);
342 return hwif->ide_dma_off_quietly(drive); 334 return hwif->ide_dma_off_quietly(drive);
343 } 335 }
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 247334473519..85e8a78e10ad 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -387,19 +387,13 @@ static int piix_config_drive_for_dma (ide_drive_t *drive)
387static int piix_config_drive_xfer_rate (ide_drive_t *drive) 387static int piix_config_drive_xfer_rate (ide_drive_t *drive)
388{ 388{
389 ide_hwif_t *hwif = HWIF(drive); 389 ide_hwif_t *hwif = HWIF(drive);
390 struct hd_driveid *id = drive->id;
391 390
392 drive->init_speed = 0; 391 drive->init_speed = 0;
393 392
394 if ((id->capability & 1) && drive->autodma) { 393 if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
394 return hwif->ide_dma_on(drive);
395 395
396 if (ide_use_dma(drive) && piix_config_drive_for_dma(drive)) 396 if (ide_use_fast_pio(drive)) {
397 return hwif->ide_dma_on(drive);
398
399 goto fast_ata_pio;
400
401 } else if ((id->capability & 8) || (id->field_valid & 2)) {
402fast_ata_pio:
403 /* Find best PIO mode. */ 397 /* Find best PIO mode. */
404 (void) hwif->speedproc(drive, XFER_PIO_0 + 398 (void) hwif->speedproc(drive, XFER_PIO_0 +
405 ide_get_best_pio_mode(drive, 255, 4, NULL)); 399 ide_get_best_pio_mode(drive, 255, 4, NULL));
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 81a0742c4594..9e92e7ba0227 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -316,21 +316,13 @@ static int config_chipset_for_dma (ide_drive_t *drive)
316static int svwks_config_drive_xfer_rate (ide_drive_t *drive) 316static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
317{ 317{
318 ide_hwif_t *hwif = HWIF(drive); 318 ide_hwif_t *hwif = HWIF(drive);
319 struct hd_driveid *id = drive->id;
320 319
321 drive->init_speed = 0; 320 drive->init_speed = 0;
322 321
323 if ((id->capability & 1) && drive->autodma) { 322 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
323 return hwif->ide_dma_on(drive);
324 324
325 if (ide_use_dma(drive)) { 325 if (ide_use_fast_pio(drive)) {
326 if (config_chipset_for_dma(drive))
327 return hwif->ide_dma_on(drive);
328 }
329
330 goto fast_ata_pio;
331
332 } else if ((id->capability & 8) || (id->field_valid & 2)) {
333fast_ata_pio:
334 config_chipset_for_pio(drive); 326 config_chipset_for_pio(drive);
335 // hwif->tuneproc(drive, 5); 327 // hwif->tuneproc(drive, 5);
336 return hwif->ide_dma_off_quietly(drive); 328 return hwif->ide_dma_off_quietly(drive);
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index ad98510026a5..367733c8c1de 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -415,19 +415,11 @@ static int config_chipset_for_dma (ide_drive_t *drive)
415static int siimage_config_drive_for_dma (ide_drive_t *drive) 415static int siimage_config_drive_for_dma (ide_drive_t *drive)
416{ 416{
417 ide_hwif_t *hwif = HWIF(drive); 417 ide_hwif_t *hwif = HWIF(drive);
418 struct hd_driveid *id = drive->id;
419 418
420 if ((id->capability & 1) != 0 && drive->autodma) { 419 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
420 return hwif->ide_dma_on(drive);
421 421
422 if (ide_use_dma(drive)) { 422 if (ide_use_fast_pio(drive)) {
423 if (config_chipset_for_dma(drive))
424 return hwif->ide_dma_on(drive);
425 }
426
427 goto fast_ata_pio;
428
429 } else if ((id->capability & 8) || (id->field_valid & 2)) {
430fast_ata_pio:
431 config_chipset_for_pio(drive, 1); 423 config_chipset_for_pio(drive, 1);
432 return hwif->ide_dma_off_quietly(drive); 424 return hwif->ide_dma_off_quietly(drive);
433 } 425 }
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index e71552e64ae4..4fff663a6432 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -670,23 +670,15 @@ static int config_chipset_for_dma (ide_drive_t *drive)
670static int sis5513_config_xfer_rate(ide_drive_t *drive) 670static int sis5513_config_xfer_rate(ide_drive_t *drive)
671{ 671{
672 ide_hwif_t *hwif = HWIF(drive); 672 ide_hwif_t *hwif = HWIF(drive);
673 struct hd_driveid *id = drive->id;
674 673
675 config_art_rwp_pio(drive, 5); 674 config_art_rwp_pio(drive, 5);
676 675
677 drive->init_speed = 0; 676 drive->init_speed = 0;
678 677
679 if (id && (id->capability & 1) && drive->autodma) { 678 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
679 return hwif->ide_dma_on(drive);
680 680
681 if (ide_use_dma(drive)) { 681 if (ide_use_fast_pio(drive)) {
682 if (config_chipset_for_dma(drive))
683 return hwif->ide_dma_on(drive);
684 }
685
686 goto fast_ata_pio;
687
688 } else if ((id->capability & 8) || (id->field_valid & 2)) {
689fast_ata_pio:
690 sis5513_tune_drive(drive, 5); 682 sis5513_tune_drive(drive, 5);
691 return hwif->ide_dma_off_quietly(drive); 683 return hwif->ide_dma_off_quietly(drive);
692 } 684 }
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 2663ddbd9b67..4042fd8e2308 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -180,19 +180,13 @@ static int slc90e66_config_drive_for_dma (ide_drive_t *drive)
180static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) 180static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
181{ 181{
182 ide_hwif_t *hwif = HWIF(drive); 182 ide_hwif_t *hwif = HWIF(drive);
183 struct hd_driveid *id = drive->id;
184 183
185 drive->init_speed = 0; 184 drive->init_speed = 0;
186 185
187 if ((id->capability & 1) && drive->autodma) { 186 if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
187 return hwif->ide_dma_on(drive);
188 188
189 if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive)) 189 if (ide_use_fast_pio(drive)) {
190 return hwif->ide_dma_on(drive);
191
192 goto fast_ata_pio;
193
194 } else if ((id->capability & 8) || (id->field_valid & 2)) {
195fast_ata_pio:
196 (void) hwif->speedproc(drive, XFER_PIO_0 + 190 (void) hwif->speedproc(drive, XFER_PIO_0 +
197 ide_get_best_pio_mode(drive, 255, 4, NULL)); 191 ide_get_best_pio_mode(drive, 255, 4, NULL));
198 return hwif->ide_dma_off_quietly(drive); 192 return hwif->ide_dma_off_quietly(drive);
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index 2ad72bbda342..4e893808f063 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -186,17 +186,11 @@ static int config_chipset_for_dma(ide_drive_t *drive)
186static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive) 186static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive)
187{ 187{
188 ide_hwif_t *hwif = HWIF(drive); 188 ide_hwif_t *hwif = HWIF(drive);
189 struct hd_driveid *id = drive->id;
190 189
191 if ((id->capability & 1) && drive->autodma) { 190 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
191 return hwif->ide_dma_on(drive);
192 192
193 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 193 if (ide_use_fast_pio(drive)) {
194 return hwif->ide_dma_on(drive);
195
196 goto fast_ata_pio;
197
198 } else if ((id->capability & 8) || (id->field_valid & 2)) {
199fast_ata_pio:
200 tc86c001_tune_drive(drive, 255); 194 tc86c001_tune_drive(drive, 255);
201 return hwif->ide_dma_off_quietly(drive); 195 return hwif->ide_dma_off_quietly(drive);
202 } 196 }
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index b0d29cd7123a..1f5f6759fef8 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -114,14 +114,9 @@ static int triflex_config_drive_for_dma(ide_drive_t *drive)
114static int triflex_config_drive_xfer_rate(ide_drive_t *drive) 114static int triflex_config_drive_xfer_rate(ide_drive_t *drive)
115{ 115{
116 ide_hwif_t *hwif = HWIF(drive); 116 ide_hwif_t *hwif = HWIF(drive);
117 struct hd_driveid *id = drive->id;
118 117
119 if ((id->capability & 1) && drive->autodma) { 118 if (ide_use_dma(drive) && triflex_config_drive_for_dma(drive))
120 if (ide_use_dma(drive)) { 119 return hwif->ide_dma_on(drive);
121 if (triflex_config_drive_for_dma(drive))
122 return hwif->ide_dma_on(drive);
123 }
124 }
125 120
126 hwif->tuneproc(drive, 255); 121 hwif->tuneproc(drive, 255);
127 return hwif->ide_dma_off_quietly(drive); 122 return hwif->ide_dma_off_quietly(drive);