aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-20 16:42:55 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-20 16:42:55 -0400
commit1116fae5fdfa80c6744a9b5d75fb3ef687a69b19 (patch)
treebaac86f015f51f1f257219f154a86a08f8529385 /drivers/ide/ide-dma.c
parent8292e8c7e4c2b99f22120f677858487de43c484b (diff)
ide: config_drive_for_dma() fixes
* Add DMA blacklist checking (->ide_dma_on check probably can go now). * Add ->atapi_dma flag checking and remove no longer needed ns87415_ide_dma_check() from ns87415 host driver. * Remove now needless __ide_dma_check() wrapper and symbol export. * Check drive->autodma instead of hwif->autodma (there should be no changes in behavior as all users of config_drive_for_dma() set both ->autodma flags). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 5fe1d72ab451..865a2740a6e3 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -349,9 +349,17 @@ EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
349 349
350static int config_drive_for_dma (ide_drive_t *drive) 350static int config_drive_for_dma (ide_drive_t *drive)
351{ 351{
352 ide_hwif_t *hwif = drive->hwif;
352 struct hd_driveid *id = drive->id; 353 struct hd_driveid *id = drive->id;
353 354
354 if ((id->capability & 1) && drive->hwif->autodma) { 355 /* consult the list of known "bad" drives */
356 if (__ide_dma_bad_drive(drive))
357 return -1;
358
359 if (drive->media != ide_disk && hwif->atapi_dma == 0)
360 return -1;
361
362 if ((id->capability & 1) && drive->autodma) {
355 /* 363 /*
356 * Enable DMA on any drive that has 364 * Enable DMA on any drive that has
357 * UltraDMA (mode 0/1/2/3/4/5/6) enabled 365 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
@@ -514,20 +522,6 @@ int __ide_dma_on (ide_drive_t *drive)
514EXPORT_SYMBOL(__ide_dma_on); 522EXPORT_SYMBOL(__ide_dma_on);
515 523
516/** 524/**
517 * __ide_dma_check - check DMA setup
518 * @drive: drive to check
519 *
520 * Don't use - due for extermination
521 */
522
523int __ide_dma_check (ide_drive_t *drive)
524{
525 return config_drive_for_dma(drive);
526}
527
528EXPORT_SYMBOL(__ide_dma_check);
529
530/**
531 * ide_dma_setup - begin a DMA phase 525 * ide_dma_setup - begin a DMA phase
532 * @drive: target device 526 * @drive: target device
533 * 527 *
@@ -1021,7 +1015,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
1021 if (!hwif->dma_host_on) 1015 if (!hwif->dma_host_on)
1022 hwif->dma_host_on = &ide_dma_host_on; 1016 hwif->dma_host_on = &ide_dma_host_on;
1023 if (!hwif->ide_dma_check) 1017 if (!hwif->ide_dma_check)
1024 hwif->ide_dma_check = &__ide_dma_check; 1018 hwif->ide_dma_check = &config_drive_for_dma;
1025 if (!hwif->dma_setup) 1019 if (!hwif->dma_setup)
1026 hwif->dma_setup = &ide_dma_setup; 1020 hwif->dma_setup = &ide_dma_setup;
1027 if (!hwif->dma_exec_cmd) 1021 if (!hwif->dma_exec_cmd)