aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:26 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:26 -0500
commit7469aaf6a30f4187ed6de7c0aed5c2dd2d1c2d31 (patch)
tree079930f23b3d14e4ad29ab972bc6d91fde52e5f0
parent3608b5d71a52c053787dbad6af20c25f7e0b75a9 (diff)
ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2)
* since ide_hwif_t.ide_dma_{host_off,off_quietly} always return '0' make these functions void and while at it drop "ide_" prefix * fix comment for __ide_dma_off_quietly() * make __ide_dma_{host_off,off_quietly,off}() void and drop "__" prefix v2: * while at it rename atiixp_ide_dma_host_off() to atiixp_dma_host_off(), sgiioc4_ide_dma_{host_off,off_quietly}() to sgiioc4_dma_{host_off,off_quietly}() and sl82c105_ide_dma_off_quietly() to sl82c105_dma_off_quietly() [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/arm/icside.c10
-rw-r--r--drivers/ide/cris/ide-cris.c14
-rw-r--r--drivers/ide/ide-cd.c6
-rw-r--r--drivers/ide/ide-dma.c39
-rw-r--r--drivers/ide/ide-floppy.c8
-rw-r--r--drivers/ide/ide-io.c2
-rw-r--r--drivers/ide/ide-iops.c8
-rw-r--r--drivers/ide/ide-probe.c2
-rw-r--r--drivers/ide/ide-tape.c4
-rw-r--r--drivers/ide/ide.c10
-rw-r--r--drivers/ide/mips/au1xxx-ide.c11
-rw-r--r--drivers/ide/pci/atiixp.c6
-rw-r--r--drivers/ide/pci/cs5530.c2
-rw-r--r--drivers/ide/pci/it821x.c2
-rw-r--r--drivers/ide/pci/sc1200.c6
-rw-r--r--drivers/ide/pci/sgiioc4.c14
-rw-r--r--drivers/ide/pci/sl82c105.c13
-rw-r--r--drivers/ide/ppc/pmac.c8
-rw-r--r--include/linux/ide.h12
19 files changed, 78 insertions, 99 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index aeed0205ce64..de3739270bc0 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -307,15 +307,13 @@ static int icside_set_speed(ide_drive_t *drive, u8 xfer_mode)
307 return on; 307 return on;
308} 308}
309 309
310static int icside_dma_host_off(ide_drive_t *drive) 310static void icside_dma_host_off(ide_drive_t *drive)
311{ 311{
312 return 0;
313} 312}
314 313
315static int icside_dma_off_quietly(ide_drive_t *drive) 314static void icside_dma_off_quietly(ide_drive_t *drive)
316{ 315{
317 drive->using_dma = 0; 316 drive->using_dma = 0;
318 return icside_dma_host_off(drive);
319} 317}
320 318
321static int icside_dma_host_on(ide_drive_t *drive) 319static int icside_dma_host_on(ide_drive_t *drive)
@@ -494,8 +492,8 @@ static void icside_dma_init(ide_hwif_t *hwif)
494 hwif->autodma = autodma; 492 hwif->autodma = autodma;
495 493
496 hwif->ide_dma_check = icside_dma_check; 494 hwif->ide_dma_check = icside_dma_check;
497 hwif->ide_dma_host_off = icside_dma_host_off; 495 hwif->dma_host_off = icside_dma_host_off;
498 hwif->ide_dma_off_quietly = icside_dma_off_quietly; 496 hwif->dma_off_quietly = icside_dma_off_quietly;
499 hwif->ide_dma_host_on = icside_dma_host_on; 497 hwif->ide_dma_host_on = icside_dma_host_on;
500 hwif->ide_dma_on = icside_dma_on; 498 hwif->ide_dma_on = icside_dma_on;
501 hwif->dma_setup = icside_dma_setup; 499 hwif->dma_setup = icside_dma_setup;
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 027341d66b28..c81b2719bca6 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -682,9 +682,12 @@ static void cris_ide_input_data (ide_drive_t *drive, void *, unsigned int);
682static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int); 682static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int);
683static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int); 683static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
684static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int); 684static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
685static int cris_dma_off (ide_drive_t *drive);
686static int cris_dma_on (ide_drive_t *drive); 685static int cris_dma_on (ide_drive_t *drive);
687 686
687static void cris_dma_off(ide_drive_t *drive)
688{
689}
690
688static void tune_cris_ide(ide_drive_t *drive, u8 pio) 691static void tune_cris_ide(ide_drive_t *drive, u8 pio)
689{ 692{
690 int setup, strobe, hold; 693 int setup, strobe, hold;
@@ -814,9 +817,9 @@ init_e100_ide (void)
814 hwif->OUTBSYNC = &cris_ide_outbsync; 817 hwif->OUTBSYNC = &cris_ide_outbsync;
815 hwif->INB = &cris_ide_inb; 818 hwif->INB = &cris_ide_inb;
816 hwif->INW = &cris_ide_inw; 819 hwif->INW = &cris_ide_inw;
817 hwif->ide_dma_host_off = &cris_dma_off; 820 hwif->dma_host_off = &cris_dma_off;
818 hwif->ide_dma_host_on = &cris_dma_on; 821 hwif->ide_dma_host_on = &cris_dma_on;
819 hwif->ide_dma_off_quietly = &cris_dma_off; 822 hwif->dma_off_quietly = &cris_dma_off;
820 hwif->udma_four = 0; 823 hwif->udma_four = 0;
821 hwif->ultra_mask = cris_ultra_mask; 824 hwif->ultra_mask = cris_ultra_mask;
822 hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ 825 hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
@@ -838,11 +841,6 @@ init_e100_ide (void)
838 cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); 841 cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
839} 842}
840 843
841static int cris_dma_off (ide_drive_t *drive)
842{
843 return 0;
844}
845
846static int cris_dma_on (ide_drive_t *drive) 844static int cris_dma_on (ide_drive_t *drive)
847{ 845{
848 return 0; 846 return 0;
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 624d48841533..45a928c058cf 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1104,7 +1104,7 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
1104 if (dma) { 1104 if (dma) {
1105 info->dma = 0; 1105 info->dma = 0;
1106 if ((dma_error = HWIF(drive)->ide_dma_end(drive))) 1106 if ((dma_error = HWIF(drive)->ide_dma_end(drive)))
1107 __ide_dma_off(drive); 1107 ide_dma_off(drive);
1108 } 1108 }
1109 1109
1110 if (cdrom_decode_status(drive, 0, &stat)) 1110 if (cdrom_decode_status(drive, 0, &stat))
@@ -1700,7 +1700,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1700 if (dma) { 1700 if (dma) {
1701 if (dma_error) { 1701 if (dma_error) {
1702 printk(KERN_ERR "ide-cd: dma error\n"); 1702 printk(KERN_ERR "ide-cd: dma error\n");
1703 __ide_dma_off(drive); 1703 ide_dma_off(drive);
1704 return ide_error(drive, "dma error", stat); 1704 return ide_error(drive, "dma error", stat);
1705 } 1705 }
1706 1706
@@ -1826,7 +1826,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
1826 info->dma = 0; 1826 info->dma = 0;
1827 if ((dma_error = HWIF(drive)->ide_dma_end(drive))) { 1827 if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
1828 printk(KERN_ERR "ide-cd: write dma error\n"); 1828 printk(KERN_ERR "ide-cd: write dma error\n");
1829 __ide_dma_off(drive); 1829 ide_dma_off(drive);
1830 } 1830 }
1831 } 1831 }
1832 1832
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 4fbcea4c1025..a15217b136f5 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -414,61 +414,57 @@ static int dma_timer_expiry (ide_drive_t *drive)
414} 414}
415 415
416/** 416/**
417 * __ide_dma_host_off - Generic DMA kill 417 * ide_dma_host_off - Generic DMA kill
418 * @drive: drive to control 418 * @drive: drive to control
419 * 419 *
420 * Perform the generic IDE controller DMA off operation. This 420 * Perform the generic IDE controller DMA off operation. This
421 * works for most IDE bus mastering controllers 421 * works for most IDE bus mastering controllers
422 */ 422 */
423 423
424int __ide_dma_host_off (ide_drive_t *drive) 424void ide_dma_host_off(ide_drive_t *drive)
425{ 425{
426 ide_hwif_t *hwif = HWIF(drive); 426 ide_hwif_t *hwif = HWIF(drive);
427 u8 unit = (drive->select.b.unit & 0x01); 427 u8 unit = (drive->select.b.unit & 0x01);
428 u8 dma_stat = hwif->INB(hwif->dma_status); 428 u8 dma_stat = hwif->INB(hwif->dma_status);
429 429
430 hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status); 430 hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status);
431 return 0;
432} 431}
433 432
434EXPORT_SYMBOL(__ide_dma_host_off); 433EXPORT_SYMBOL(ide_dma_host_off);
435 434
436/** 435/**
437 * __ide_dma_host_off_quietly - Generic DMA kill 436 * ide_dma_off_quietly - Generic DMA kill
438 * @drive: drive to control 437 * @drive: drive to control
439 * 438 *
440 * Turn off the current DMA on this IDE controller. 439 * Turn off the current DMA on this IDE controller.
441 */ 440 */
442 441
443int __ide_dma_off_quietly (ide_drive_t *drive) 442void ide_dma_off_quietly(ide_drive_t *drive)
444{ 443{
445 drive->using_dma = 0; 444 drive->using_dma = 0;
446 ide_toggle_bounce(drive, 0); 445 ide_toggle_bounce(drive, 0);
447 446
448 if (HWIF(drive)->ide_dma_host_off(drive)) 447 drive->hwif->dma_host_off(drive);
449 return 1;
450
451 return 0;
452} 448}
453 449
454EXPORT_SYMBOL(__ide_dma_off_quietly); 450EXPORT_SYMBOL(ide_dma_off_quietly);
455#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 451#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
456 452
457/** 453/**
458 * __ide_dma_off - disable DMA on a device 454 * ide_dma_off - disable DMA on a device
459 * @drive: drive to disable DMA on 455 * @drive: drive to disable DMA on
460 * 456 *
461 * Disable IDE DMA for a device on this IDE controller. 457 * Disable IDE DMA for a device on this IDE controller.
462 * Inform the user that DMA has been disabled. 458 * Inform the user that DMA has been disabled.
463 */ 459 */
464 460
465int __ide_dma_off (ide_drive_t *drive) 461void ide_dma_off(ide_drive_t *drive)
466{ 462{
467 printk(KERN_INFO "%s: DMA disabled\n", drive->name); 463 printk(KERN_INFO "%s: DMA disabled\n", drive->name);
468 return HWIF(drive)->ide_dma_off_quietly(drive); 464 drive->hwif->dma_off_quietly(drive);
469} 465}
470 466
471EXPORT_SYMBOL(__ide_dma_off); 467EXPORT_SYMBOL(ide_dma_off);
472 468
473#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 469#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
474/** 470/**
@@ -758,7 +754,7 @@ void ide_dma_verbose(ide_drive_t *drive)
758 return; 754 return;
759bug_dma_off: 755bug_dma_off:
760 printk(", BUG DMA OFF"); 756 printk(", BUG DMA OFF");
761 hwif->ide_dma_off_quietly(drive); 757 hwif->dma_off_quietly(drive);
762 return; 758 return;
763} 759}
764 760
@@ -773,7 +769,8 @@ int ide_set_dma(ide_drive_t *drive)
773 769
774 switch(rc) { 770 switch(rc) {
775 case -1: /* DMA needs to be disabled */ 771 case -1: /* DMA needs to be disabled */
776 return hwif->ide_dma_off_quietly(drive); 772 hwif->dma_off_quietly(drive);
773 return 0;
777 case 0: /* DMA needs to be enabled */ 774 case 0: /* DMA needs to be enabled */
778 return hwif->ide_dma_on(drive); 775 return hwif->ide_dma_on(drive);
779 case 1: /* DMA setting cannot be changed */ 776 case 1: /* DMA setting cannot be changed */
@@ -937,10 +934,10 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
937 if (!(hwif->dma_prdtable)) 934 if (!(hwif->dma_prdtable))
938 hwif->dma_prdtable = (hwif->dma_base + 4); 935 hwif->dma_prdtable = (hwif->dma_base + 4);
939 936
940 if (!hwif->ide_dma_off_quietly) 937 if (!hwif->dma_off_quietly)
941 hwif->ide_dma_off_quietly = &__ide_dma_off_quietly; 938 hwif->dma_off_quietly = &ide_dma_off_quietly;
942 if (!hwif->ide_dma_host_off) 939 if (!hwif->dma_host_off)
943 hwif->ide_dma_host_off = &__ide_dma_host_off; 940 hwif->dma_host_off = &ide_dma_host_off;
944 if (!hwif->ide_dma_on) 941 if (!hwif->ide_dma_on)
945 hwif->ide_dma_on = &__ide_dma_on; 942 hwif->ide_dma_on = &__ide_dma_on;
946 if (!hwif->ide_dma_host_on) 943 if (!hwif->ide_dma_host_on)
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 61969415c57b..57cd21c5b2c1 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -867,7 +867,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
867 if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { 867 if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) {
868 printk(KERN_ERR "ide-floppy: The floppy wants to issue " 868 printk(KERN_ERR "ide-floppy: The floppy wants to issue "
869 "more interrupts in DMA mode\n"); 869 "more interrupts in DMA mode\n");
870 (void)__ide_dma_off(drive); 870 ide_dma_off(drive);
871 return ide_do_reset(drive); 871 return ide_do_reset(drive);
872 } 872 }
873 873
@@ -1097,9 +1097,9 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
1097 pc->current_position = pc->buffer; 1097 pc->current_position = pc->buffer;
1098 bcount.all = min(pc->request_transfer, 63 * 1024); 1098 bcount.all = min(pc->request_transfer, 63 * 1024);
1099 1099
1100 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { 1100 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags))
1101 (void)__ide_dma_off(drive); 1101 ide_dma_off(drive);
1102 } 1102
1103 feature.all = 0; 1103 feature.all = 0;
1104 1104
1105 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) 1105 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 9f45a84588d9..c193553f6fe7 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1351,7 +1351,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
1351 */ 1351 */
1352 drive->retry_pio++; 1352 drive->retry_pio++;
1353 drive->state = DMA_PIO_RETRY; 1353 drive->state = DMA_PIO_RETRY;
1354 (void) hwif->ide_dma_off_quietly(drive); 1354 hwif->dma_off_quietly(drive);
1355 1355
1356 /* 1356 /*
1357 * un-busy drive etc (hwgroup->busy is cleared on return) and 1357 * un-busy drive etc (hwgroup->busy is cleared on return) and
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 09c30cbf4bd7..5ecdb11a3462 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -753,7 +753,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
753 753
754#ifdef CONFIG_BLK_DEV_IDEDMA 754#ifdef CONFIG_BLK_DEV_IDEDMA
755 if (hwif->ide_dma_check) /* check if host supports DMA */ 755 if (hwif->ide_dma_check) /* check if host supports DMA */
756 hwif->ide_dma_host_off(drive); 756 hwif->dma_host_off(drive);
757#endif 757#endif
758 758
759 /* 759 /*
@@ -832,7 +832,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
832 if (speed >= XFER_SW_DMA_0) 832 if (speed >= XFER_SW_DMA_0)
833 hwif->ide_dma_host_on(drive); 833 hwif->ide_dma_host_on(drive);
834 else if (hwif->ide_dma_check) /* check if host supports DMA */ 834 else if (hwif->ide_dma_check) /* check if host supports DMA */
835 hwif->ide_dma_off_quietly(drive); 835 hwif->dma_off_quietly(drive);
836#endif 836#endif
837 837
838 switch(speed) { 838 switch(speed) {
@@ -1042,12 +1042,12 @@ static void check_dma_crc(ide_drive_t *drive)
1042{ 1042{
1043#ifdef CONFIG_BLK_DEV_IDEDMA 1043#ifdef CONFIG_BLK_DEV_IDEDMA
1044 if (drive->crc_count) { 1044 if (drive->crc_count) {
1045 (void) HWIF(drive)->ide_dma_off_quietly(drive); 1045 drive->hwif->dma_off_quietly(drive);
1046 ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive)); 1046 ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
1047 if (drive->current_speed >= XFER_SW_DMA_0) 1047 if (drive->current_speed >= XFER_SW_DMA_0)
1048 (void) HWIF(drive)->ide_dma_on(drive); 1048 (void) HWIF(drive)->ide_dma_on(drive);
1049 } else 1049 } else
1050 (void)__ide_dma_off(drive); 1050 ide_dma_off(drive);
1051#endif 1051#endif
1052} 1052}
1053 1053
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 72218f3e440f..8afbd6cb94be 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -853,7 +853,7 @@ static void probe_hwif(ide_hwif_t *hwif)
853 * things, if not checked and cleared. 853 * things, if not checked and cleared.
854 * PARANOIA!!! 854 * PARANOIA!!!
855 */ 855 */
856 hwif->ide_dma_off_quietly(drive); 856 hwif->dma_off_quietly(drive);
857#ifdef CONFIG_IDEDMA_ONLYDISK 857#ifdef CONFIG_IDEDMA_ONLYDISK
858 if (drive->media == ide_disk) 858 if (drive->media == ide_disk)
859#endif 859#endif
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index be6d818d0db8..4e59239fef75 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1970,7 +1970,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1970 printk(KERN_ERR "ide-tape: The tape wants to issue more " 1970 printk(KERN_ERR "ide-tape: The tape wants to issue more "
1971 "interrupts in DMA mode\n"); 1971 "interrupts in DMA mode\n");
1972 printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n"); 1972 printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n");
1973 (void)__ide_dma_off(drive); 1973 ide_dma_off(drive);
1974 return ide_do_reset(drive); 1974 return ide_do_reset(drive);
1975 } 1975 }
1976 /* Get the number of bytes to transfer on this interrupt. */ 1976 /* Get the number of bytes to transfer on this interrupt. */
@@ -2176,7 +2176,7 @@ static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape
2176 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { 2176 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) {
2177 printk(KERN_WARNING "ide-tape: DMA disabled, " 2177 printk(KERN_WARNING "ide-tape: DMA disabled, "
2178 "reverting to PIO\n"); 2178 "reverting to PIO\n");
2179 (void)__ide_dma_off(drive); 2179 ide_dma_off(drive);
2180 } 2180 }
2181 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) 2181 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
2182 dma_ok = !hwif->dma_setup(drive); 2182 dma_ok = !hwif->dma_setup(drive);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 5585c01a9b7f..6e146b54257d 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -506,11 +506,11 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
506 hwif->ide_dma_end = tmp_hwif->ide_dma_end; 506 hwif->ide_dma_end = tmp_hwif->ide_dma_end;
507 hwif->ide_dma_check = tmp_hwif->ide_dma_check; 507 hwif->ide_dma_check = tmp_hwif->ide_dma_check;
508 hwif->ide_dma_on = tmp_hwif->ide_dma_on; 508 hwif->ide_dma_on = tmp_hwif->ide_dma_on;
509 hwif->ide_dma_off_quietly = tmp_hwif->ide_dma_off_quietly; 509 hwif->dma_off_quietly = tmp_hwif->dma_off_quietly;
510 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; 510 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq;
511 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq; 511 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq;
512 hwif->ide_dma_host_on = tmp_hwif->ide_dma_host_on; 512 hwif->ide_dma_host_on = tmp_hwif->ide_dma_host_on;
513 hwif->ide_dma_host_off = tmp_hwif->ide_dma_host_off; 513 hwif->dma_host_off = tmp_hwif->dma_host_off;
514 hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq; 514 hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq;
515 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout; 515 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout;
516 516
@@ -1138,10 +1138,8 @@ static int set_using_dma (ide_drive_t *drive, int arg)
1138 if (ide_set_dma(drive)) 1138 if (ide_set_dma(drive))
1139 return -EIO; 1139 return -EIO;
1140 if (HWIF(drive)->ide_dma_on(drive)) return -EIO; 1140 if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
1141 } else { 1141 } else
1142 if (__ide_dma_off(drive)) 1142 ide_dma_off(drive);
1143 return -EIO;
1144 }
1145 return 0; 1143 return 0;
1146#else 1144#else
1147 return -EPERM; 1145 return -EPERM;
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 8a723c81c4b8..266ef37a2807 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -449,16 +449,13 @@ static int auide_dma_on(ide_drive_t *drive)
449 return auide_dma_host_on(drive); 449 return auide_dma_host_on(drive);
450} 450}
451 451
452 452static void auide_dma_host_off(ide_drive_t *drive)
453static int auide_dma_host_off(ide_drive_t *drive)
454{ 453{
455 return 0;
456} 454}
457 455
458static int auide_dma_off_quietly(ide_drive_t *drive) 456static void auide_dma_off_quietly(ide_drive_t *drive)
459{ 457{
460 drive->using_dma = 0; 458 drive->using_dma = 0;
461 return auide_dma_host_off(drive);
462} 459}
463 460
464static int auide_dma_lostirq(ide_drive_t *drive) 461static int auide_dma_lostirq(ide_drive_t *drive)
@@ -724,7 +721,7 @@ static int au_ide_probe(struct device *dev)
724 hwif->speedproc = &auide_tune_chipset; 721 hwif->speedproc = &auide_tune_chipset;
725 722
726#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 723#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
727 hwif->ide_dma_off_quietly = &auide_dma_off_quietly; 724 hwif->dma_off_quietly = &auide_dma_off_quietly;
728 hwif->ide_dma_timeout = &auide_dma_timeout; 725 hwif->ide_dma_timeout = &auide_dma_timeout;
729 726
730 hwif->ide_dma_check = &auide_dma_check; 727 hwif->ide_dma_check = &auide_dma_check;
@@ -733,7 +730,7 @@ static int au_ide_probe(struct device *dev)
733 hwif->ide_dma_end = &auide_dma_end; 730 hwif->ide_dma_end = &auide_dma_end;
734 hwif->dma_setup = &auide_dma_setup; 731 hwif->dma_setup = &auide_dma_setup;
735 hwif->ide_dma_test_irq = &auide_dma_test_irq; 732 hwif->ide_dma_test_irq = &auide_dma_test_irq;
736 hwif->ide_dma_host_off = &auide_dma_host_off; 733 hwif->dma_host_off = &auide_dma_host_off;
737 hwif->ide_dma_host_on = &auide_dma_host_on; 734 hwif->ide_dma_host_on = &auide_dma_host_on;
738 hwif->ide_dma_lostirq = &auide_dma_lostirq; 735 hwif->ide_dma_lostirq = &auide_dma_lostirq;
739 hwif->ide_dma_on = &auide_dma_on; 736 hwif->ide_dma_on = &auide_dma_on;
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index e7b4415adc83..ed32be174200 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -121,7 +121,7 @@ static int atiixp_ide_dma_host_on(ide_drive_t *drive)
121 return __ide_dma_host_on(drive); 121 return __ide_dma_host_on(drive);
122} 122}
123 123
124static int atiixp_ide_dma_host_off(ide_drive_t *drive) 124static void atiixp_dma_host_off(ide_drive_t *drive)
125{ 125{
126 struct pci_dev *dev = drive->hwif->pci_dev; 126 struct pci_dev *dev = drive->hwif->pci_dev;
127 unsigned long flags; 127 unsigned long flags;
@@ -135,7 +135,7 @@ static int atiixp_ide_dma_host_off(ide_drive_t *drive)
135 135
136 spin_unlock_irqrestore(&atiixp_lock, flags); 136 spin_unlock_irqrestore(&atiixp_lock, flags);
137 137
138 return __ide_dma_host_off(drive); 138 ide_dma_host_off(drive);
139} 139}
140 140
141/** 141/**
@@ -306,7 +306,7 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
306 hwif->udma_four = 0; 306 hwif->udma_four = 0;
307 307
308 hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; 308 hwif->ide_dma_host_on = &atiixp_ide_dma_host_on;
309 hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; 309 hwif->dma_host_off = &atiixp_dma_host_off;
310 hwif->ide_dma_check = &atiixp_dma_check; 310 hwif->ide_dma_check = &atiixp_dma_check;
311 if (!noautodma) 311 if (!noautodma)
312 hwif->autodma = 1; 312 hwif->autodma = 1;
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index ff909cfb96b6..b2d7c132ef4b 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -109,7 +109,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
109 /* 109 /*
110 * Default to DMA-off in case we run into trouble here. 110 * Default to DMA-off in case we run into trouble here.
111 */ 111 */
112 hwif->ide_dma_off_quietly(drive); 112 hwif->dma_off_quietly(drive);
113 113
114 /* 114 /*
115 * The CS5530 specifies that two drives sharing a cable cannot 115 * The CS5530 specifies that two drives sharing a cable cannot
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 35ee17df3f8d..a132767f7d90 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -606,7 +606,7 @@ static void __devinit it821x_fixups(ide_hwif_t *hwif)
606 printk(".\n"); 606 printk(".\n");
607 /* Now the core code will have wrongly decided no DMA 607 /* Now the core code will have wrongly decided no DMA
608 so we need to fix this */ 608 so we need to fix this */
609 hwif->ide_dma_off_quietly(drive); 609 hwif->dma_off_quietly(drive);
610#ifdef CONFIG_IDEDMA_ONLYDISK 610#ifdef CONFIG_IDEDMA_ONLYDISK
611 if (drive->media == ide_disk) 611 if (drive->media == ide_disk)
612#endif 612#endif
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 08e317f281e7..b5ae0c50e216 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -161,7 +161,7 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
161 /* 161 /*
162 * Default to DMA-off in case we run into trouble here. 162 * Default to DMA-off in case we run into trouble here.
163 */ 163 */
164 hwif->ide_dma_off_quietly(drive); /* turn off DMA while we fiddle */ 164 hwif->dma_off_quietly(drive); /* turn off DMA while we fiddle */
165 outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */ 165 outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */
166 166
167 /* 167 /*
@@ -439,10 +439,10 @@ static int sc1200_resume (struct pci_dev *dev)
439 ide_drive_t *drive = &(hwif->drives[d]); 439 ide_drive_t *drive = &(hwif->drives[d]);
440 if (drive->present && !__ide_dma_bad_drive(drive)) { 440 if (drive->present && !__ide_dma_bad_drive(drive)) {
441 int was_using_dma = drive->using_dma; 441 int was_using_dma = drive->using_dma;
442 hwif->ide_dma_off_quietly(drive); 442 hwif->dma_off_quietly(drive);
443 sc1200_config_dma(drive); 443 sc1200_config_dma(drive);
444 if (!was_using_dma && drive->using_dma) { 444 if (!was_using_dma && drive->using_dma) {
445 hwif->ide_dma_off_quietly(drive); 445 hwif->dma_off_quietly(drive);
446 } 446 }
447 } 447 }
448 } 448 }
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index cb5c3211bd8e..d9aa20012fc0 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -282,12 +282,11 @@ sgiioc4_ide_dma_on(ide_drive_t * drive)
282 return HWIF(drive)->ide_dma_host_on(drive); 282 return HWIF(drive)->ide_dma_host_on(drive);
283} 283}
284 284
285static int 285static void sgiioc4_dma_off_quietly(ide_drive_t *drive)
286sgiioc4_ide_dma_off_quietly(ide_drive_t * drive)
287{ 286{
288 drive->using_dma = 0; 287 drive->using_dma = 0;
289 288
290 return HWIF(drive)->ide_dma_host_off(drive); 289 drive->hwif->dma_host_off(drive);
291} 290}
292 291
293static int sgiioc4_ide_dma_check(ide_drive_t *drive) 292static int sgiioc4_ide_dma_check(ide_drive_t *drive)
@@ -317,12 +316,9 @@ sgiioc4_ide_dma_host_on(ide_drive_t * drive)
317 return 1; 316 return 1;
318} 317}
319 318
320static int 319static void sgiioc4_dma_host_off(ide_drive_t * drive)
321sgiioc4_ide_dma_host_off(ide_drive_t * drive)
322{ 320{
323 sgiioc4_clearirq(drive); 321 sgiioc4_clearirq(drive);
324
325 return 0;
326} 322}
327 323
328static int 324static int
@@ -612,10 +608,10 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
612 hwif->ide_dma_end = &sgiioc4_ide_dma_end; 608 hwif->ide_dma_end = &sgiioc4_ide_dma_end;
613 hwif->ide_dma_check = &sgiioc4_ide_dma_check; 609 hwif->ide_dma_check = &sgiioc4_ide_dma_check;
614 hwif->ide_dma_on = &sgiioc4_ide_dma_on; 610 hwif->ide_dma_on = &sgiioc4_ide_dma_on;
615 hwif->ide_dma_off_quietly = &sgiioc4_ide_dma_off_quietly; 611 hwif->dma_off_quietly = &sgiioc4_dma_off_quietly;
616 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; 612 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
617 hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on; 613 hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on;
618 hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; 614 hwif->dma_host_off = &sgiioc4_dma_host_off;
619 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 615 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
620 hwif->ide_dma_timeout = &__ide_dma_timeout; 616 hwif->ide_dma_timeout = &__ide_dma_timeout;
621 617
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 27b21e120260..3a8a76fc78c7 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -265,19 +265,16 @@ static int sl82c105_ide_dma_on (ide_drive_t *drive)
265 return __ide_dma_on(drive); 265 return __ide_dma_on(drive);
266} 266}
267 267
268static int sl82c105_ide_dma_off_quietly (ide_drive_t *drive) 268static void sl82c105_dma_off_quietly(ide_drive_t *drive)
269{ 269{
270 u8 speed = XFER_PIO_0; 270 u8 speed = XFER_PIO_0;
271 int rc;
272
273 DBG(("sl82c105_ide_dma_off_quietly(drive:%s)\n", drive->name));
274 271
275 rc = __ide_dma_off_quietly(drive); 272 DBG(("sl82c105_dma_off_quietly(drive:%s)\n", drive->name));
273
274 ide_dma_off_quietly(drive);
276 if (drive->pio_speed) 275 if (drive->pio_speed)
277 speed = drive->pio_speed - XFER_PIO_0; 276 speed = drive->pio_speed - XFER_PIO_0;
278 config_for_pio(drive, speed, 0, 1); 277 config_for_pio(drive, speed, 0, 1);
279
280 return rc;
281} 278}
282 279
283/* 280/*
@@ -440,7 +437,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
440 437
441 hwif->ide_dma_check = &sl82c105_check_drive; 438 hwif->ide_dma_check = &sl82c105_check_drive;
442 hwif->ide_dma_on = &sl82c105_ide_dma_on; 439 hwif->ide_dma_on = &sl82c105_ide_dma_on;
443 hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly; 440 hwif->dma_off_quietly = &sl82c105_dma_off_quietly;
444 hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq; 441 hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq;
445 hwif->dma_start = &sl82c105_ide_dma_start; 442 hwif->dma_start = &sl82c105_ide_dma_start;
446 hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; 443 hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout;
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index c547c76533d5..d3bb247e9574 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1979,10 +1979,8 @@ pmac_ide_dma_test_irq (ide_drive_t *drive)
1979 return 1; 1979 return 1;
1980} 1980}
1981 1981
1982static int 1982static void pmac_ide_dma_host_off(ide_drive_t *drive)
1983pmac_ide_dma_host_off (ide_drive_t *drive)
1984{ 1983{
1985 return 0;
1986} 1984}
1987 1985
1988static int 1986static int
@@ -2034,7 +2032,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
2034 return; 2032 return;
2035 } 2033 }
2036 2034
2037 hwif->ide_dma_off_quietly = &__ide_dma_off_quietly; 2035 hwif->dma_off_quietly = &ide_dma_off_quietly;
2038 hwif->ide_dma_on = &__ide_dma_on; 2036 hwif->ide_dma_on = &__ide_dma_on;
2039 hwif->ide_dma_check = &pmac_ide_dma_check; 2037 hwif->ide_dma_check = &pmac_ide_dma_check;
2040 hwif->dma_setup = &pmac_ide_dma_setup; 2038 hwif->dma_setup = &pmac_ide_dma_setup;
@@ -2042,7 +2040,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
2042 hwif->dma_start = &pmac_ide_dma_start; 2040 hwif->dma_start = &pmac_ide_dma_start;
2043 hwif->ide_dma_end = &pmac_ide_dma_end; 2041 hwif->ide_dma_end = &pmac_ide_dma_end;
2044 hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; 2042 hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq;
2045 hwif->ide_dma_host_off = &pmac_ide_dma_host_off; 2043 hwif->dma_host_off = &pmac_ide_dma_host_off;
2046 hwif->ide_dma_host_on = &pmac_ide_dma_host_on; 2044 hwif->ide_dma_host_on = &pmac_ide_dma_host_on;
2047 hwif->ide_dma_timeout = &__ide_dma_timeout; 2045 hwif->ide_dma_timeout = &__ide_dma_timeout;
2048 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; 2046 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 08f96e8a1902..00cbe531e1e8 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -735,11 +735,11 @@ typedef struct hwif_s {
735 int (*ide_dma_end)(ide_drive_t *drive); 735 int (*ide_dma_end)(ide_drive_t *drive);
736 int (*ide_dma_check)(ide_drive_t *drive); 736 int (*ide_dma_check)(ide_drive_t *drive);
737 int (*ide_dma_on)(ide_drive_t *drive); 737 int (*ide_dma_on)(ide_drive_t *drive);
738 int (*ide_dma_off_quietly)(ide_drive_t *drive); 738 void (*dma_off_quietly)(ide_drive_t *drive);
739 int (*ide_dma_test_irq)(ide_drive_t *drive); 739 int (*ide_dma_test_irq)(ide_drive_t *drive);
740 void (*ide_dma_clear_irq)(ide_drive_t *drive); 740 void (*ide_dma_clear_irq)(ide_drive_t *drive);
741 int (*ide_dma_host_on)(ide_drive_t *drive); 741 int (*ide_dma_host_on)(ide_drive_t *drive);
742 int (*ide_dma_host_off)(ide_drive_t *drive); 742 void (*dma_host_off)(ide_drive_t *drive);
743 int (*ide_dma_lostirq)(ide_drive_t *drive); 743 int (*ide_dma_lostirq)(ide_drive_t *drive);
744 int (*ide_dma_timeout)(ide_drive_t *drive); 744 int (*ide_dma_timeout)(ide_drive_t *drive);
745 745
@@ -1276,7 +1276,7 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1276int __ide_dma_bad_drive(ide_drive_t *); 1276int __ide_dma_bad_drive(ide_drive_t *);
1277int __ide_dma_good_drive(ide_drive_t *); 1277int __ide_dma_good_drive(ide_drive_t *);
1278int ide_use_dma(ide_drive_t *); 1278int ide_use_dma(ide_drive_t *);
1279int __ide_dma_off(ide_drive_t *); 1279void ide_dma_off(ide_drive_t *);
1280void ide_dma_verbose(ide_drive_t *); 1280void ide_dma_verbose(ide_drive_t *);
1281int ide_set_dma(ide_drive_t *); 1281int ide_set_dma(ide_drive_t *);
1282ide_startstop_t ide_dma_intr(ide_drive_t *); 1282ide_startstop_t ide_dma_intr(ide_drive_t *);
@@ -1288,8 +1288,8 @@ extern void ide_destroy_dmatable(ide_drive_t *);
1288extern int ide_release_dma(ide_hwif_t *); 1288extern int ide_release_dma(ide_hwif_t *);
1289extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); 1289extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int);
1290 1290
1291extern int __ide_dma_host_off(ide_drive_t *); 1291void ide_dma_host_off(ide_drive_t *);
1292extern int __ide_dma_off_quietly(ide_drive_t *); 1292void ide_dma_off_quietly(ide_drive_t *);
1293extern int __ide_dma_host_on(ide_drive_t *); 1293extern int __ide_dma_host_on(ide_drive_t *);
1294extern int __ide_dma_on(ide_drive_t *); 1294extern int __ide_dma_on(ide_drive_t *);
1295extern int __ide_dma_check(ide_drive_t *); 1295extern int __ide_dma_check(ide_drive_t *);
@@ -1302,7 +1302,7 @@ extern int __ide_dma_timeout(ide_drive_t *);
1302 1302
1303#else 1303#else
1304static inline int ide_use_dma(ide_drive_t *drive) { return 0; } 1304static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
1305static inline int __ide_dma_off(ide_drive_t *drive) { return 0; } 1305static inline void ide_dma_off(ide_drive_t *drive) { ; }
1306static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1306static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1307static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1307static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1308#endif /* CONFIG_BLK_DEV_IDEDMA */ 1308#endif /* CONFIG_BLK_DEV_IDEDMA */