aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:01 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:01 -0500
commit4a546e046d562bcd389149591fa5a534c8f832ca (patch)
treeffc5c7bd088a0bf74744721b9cfcf18220a75fdf /drivers/ide/ide-dma.c
parent378f577f7f75aa18a0eeafb044a491dcd5aeaa3d (diff)
ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t
* Make ide_dma_off_quietly() and __ide_dma_on() always available. * Drop "__" prefix from __ide_dma_on(). * Check for presence of ->dma_host_on instead of ->ide_dma_on. * Convert all users of ->ide_dma_on and ->dma_off_quietly methods to use ide_dma_on() and ide_dma_off_quietly() instead. * Remove no longer needed ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t. * Make ide_dma_on() void. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 9d6dabbbf809..edd0018c4988 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -425,6 +425,7 @@ void ide_dma_host_off(ide_drive_t *drive)
425} 425}
426 426
427EXPORT_SYMBOL(ide_dma_host_off); 427EXPORT_SYMBOL(ide_dma_host_off);
428#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
428 429
429/** 430/**
430 * ide_dma_off_quietly - Generic DMA kill 431 * ide_dma_off_quietly - Generic DMA kill
@@ -442,7 +443,6 @@ void ide_dma_off_quietly(ide_drive_t *drive)
442} 443}
443 444
444EXPORT_SYMBOL(ide_dma_off_quietly); 445EXPORT_SYMBOL(ide_dma_off_quietly);
445#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
446 446
447/** 447/**
448 * ide_dma_off - disable DMA on a device 448 * ide_dma_off - disable DMA on a device
@@ -455,7 +455,7 @@ EXPORT_SYMBOL(ide_dma_off_quietly);
455void ide_dma_off(ide_drive_t *drive) 455void ide_dma_off(ide_drive_t *drive)
456{ 456{
457 printk(KERN_INFO "%s: DMA disabled\n", drive->name); 457 printk(KERN_INFO "%s: DMA disabled\n", drive->name);
458 drive->hwif->dma_off_quietly(drive); 458 ide_dma_off_quietly(drive);
459} 459}
460 460
461EXPORT_SYMBOL(ide_dma_off); 461EXPORT_SYMBOL(ide_dma_off);
@@ -481,26 +481,26 @@ void ide_dma_host_on(ide_drive_t *drive)
481} 481}
482 482
483EXPORT_SYMBOL(ide_dma_host_on); 483EXPORT_SYMBOL(ide_dma_host_on);
484#endif
484 485
485/** 486/**
486 * __ide_dma_on - Enable DMA on a device 487 * ide_dma_on - Enable DMA on a device
487 * @drive: drive to enable DMA on 488 * @drive: drive to enable DMA on
488 * 489 *
489 * Enable IDE DMA for a device on this IDE controller. 490 * Enable IDE DMA for a device on this IDE controller.
490 */ 491 */
491 492
492int __ide_dma_on (ide_drive_t *drive) 493void ide_dma_on(ide_drive_t *drive)
493{ 494{
494 drive->using_dma = 1; 495 drive->using_dma = 1;
495 ide_toggle_bounce(drive, 1); 496 ide_toggle_bounce(drive, 1);
496 497
497 drive->hwif->dma_host_on(drive); 498 drive->hwif->dma_host_on(drive);
498
499 return 0;
500} 499}
501 500
502EXPORT_SYMBOL(__ide_dma_on); 501EXPORT_SYMBOL(ide_dma_on);
503 502
503#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
504/** 504/**
505 * ide_dma_setup - begin a DMA phase 505 * ide_dma_setup - begin a DMA phase
506 * @drive: target device 506 * @drive: target device
@@ -827,7 +827,6 @@ err_out:
827 827
828int ide_set_dma(ide_drive_t *drive) 828int ide_set_dma(ide_drive_t *drive)
829{ 829{
830 ide_hwif_t *hwif = drive->hwif;
831 int rc; 830 int rc;
832 831
833 /* 832 /*
@@ -836,13 +835,15 @@ int ide_set_dma(ide_drive_t *drive)
836 * things, if not checked and cleared. 835 * things, if not checked and cleared.
837 * PARANOIA!!! 836 * PARANOIA!!!
838 */ 837 */
839 hwif->dma_off_quietly(drive); 838 ide_dma_off_quietly(drive);
840 839
841 rc = ide_dma_check(drive); 840 rc = ide_dma_check(drive);
842 if (rc) 841 if (rc)
843 return rc; 842 return rc;
844 843
845 return hwif->ide_dma_on(drive); 844 ide_dma_on(drive);
845
846 return 0;
846} 847}
847 848
848#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 849#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
@@ -979,12 +980,8 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
979 if (!(hwif->dma_prdtable)) 980 if (!(hwif->dma_prdtable))
980 hwif->dma_prdtable = (hwif->dma_base + 4); 981 hwif->dma_prdtable = (hwif->dma_base + 4);
981 982
982 if (!hwif->dma_off_quietly)
983 hwif->dma_off_quietly = &ide_dma_off_quietly;
984 if (!hwif->dma_host_off) 983 if (!hwif->dma_host_off)
985 hwif->dma_host_off = &ide_dma_host_off; 984 hwif->dma_host_off = &ide_dma_host_off;
986 if (!hwif->ide_dma_on)
987 hwif->ide_dma_on = &__ide_dma_on;
988 if (!hwif->dma_host_on) 985 if (!hwif->dma_host_on)
989 hwif->dma_host_on = &ide_dma_host_on; 986 hwif->dma_host_on = &ide_dma_host_on;
990 if (!hwif->dma_setup) 987 if (!hwif->dma_setup)