aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
commitccf352894ceef79d40d015e1deee4c46c3aa42ed (patch)
treee30b2b8a4c30e2ef1719ce9780322e671ebe3c43 /drivers
parent7469aaf6a30f4187ed6de7c0aed5c2dd2d1c2d31 (diff)
ide: make ide_hwif_t.ide_dma_host_on void (v2)
* since ide_hwif_t.ide_dma_host_on is called either when drive->using_dma == 1 or when return value is discarded make it void, also drop "ide_" prefix * make __ide_dma_host_on() void and drop "__" prefix v2: * while at it rename atiixp_ide_dma_host_on() to atiixp_dma_host_on() and sgiioc4_ide_dma_host_on() to sgiioc4_dma_host_on(). [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/arm/icside.c8
-rw-r--r--drivers/ide/cris/ide-cris.c2
-rw-r--r--drivers/ide/ide-dma.c17
-rw-r--r--drivers/ide/ide-iops.c2
-rw-r--r--drivers/ide/ide.c2
-rw-r--r--drivers/ide/mips/au1xxx-ide.c8
-rw-r--r--drivers/ide/pci/atiixp.c6
-rw-r--r--drivers/ide/pci/sgiioc4.c11
-rw-r--r--drivers/ide/ppc/pmac.c6
9 files changed, 26 insertions, 36 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index de3739270bc0..40e5c66b81ce 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -316,15 +316,15 @@ static void icside_dma_off_quietly(ide_drive_t *drive)
316 drive->using_dma = 0; 316 drive->using_dma = 0;
317} 317}
318 318
319static int icside_dma_host_on(ide_drive_t *drive) 319static void icside_dma_host_on(ide_drive_t *drive)
320{ 320{
321 return 0;
322} 321}
323 322
324static int icside_dma_on(ide_drive_t *drive) 323static int icside_dma_on(ide_drive_t *drive)
325{ 324{
326 drive->using_dma = 1; 325 drive->using_dma = 1;
327 return icside_dma_host_on(drive); 326
327 return 0;
328} 328}
329 329
330static int icside_dma_check(ide_drive_t *drive) 330static int icside_dma_check(ide_drive_t *drive)
@@ -494,7 +494,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
494 hwif->ide_dma_check = icside_dma_check; 494 hwif->ide_dma_check = icside_dma_check;
495 hwif->dma_host_off = icside_dma_host_off; 495 hwif->dma_host_off = icside_dma_host_off;
496 hwif->dma_off_quietly = icside_dma_off_quietly; 496 hwif->dma_off_quietly = icside_dma_off_quietly;
497 hwif->ide_dma_host_on = icside_dma_host_on; 497 hwif->dma_host_on = icside_dma_host_on;
498 hwif->ide_dma_on = icside_dma_on; 498 hwif->ide_dma_on = icside_dma_on;
499 hwif->dma_setup = icside_dma_setup; 499 hwif->dma_setup = icside_dma_setup;
500 hwif->dma_exec_cmd = icside_dma_exec_cmd; 500 hwif->dma_exec_cmd = icside_dma_exec_cmd;
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index c81b2719bca6..6b2d152351b3 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -818,7 +818,7 @@ init_e100_ide (void)
818 hwif->INB = &cris_ide_inb; 818 hwif->INB = &cris_ide_inb;
819 hwif->INW = &cris_ide_inw; 819 hwif->INW = &cris_ide_inw;
820 hwif->dma_host_off = &cris_dma_off; 820 hwif->dma_host_off = &cris_dma_off;
821 hwif->ide_dma_host_on = &cris_dma_on; 821 hwif->dma_host_on = &cris_dma_on;
822 hwif->dma_off_quietly = &cris_dma_off; 822 hwif->dma_off_quietly = &cris_dma_off;
823 hwif->udma_four = 0; 823 hwif->udma_four = 0;
824 hwif->ultra_mask = cris_ultra_mask; 824 hwif->ultra_mask = cris_ultra_mask;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a15217b136f5..08e7cd043bcc 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -468,14 +468,14 @@ EXPORT_SYMBOL(ide_dma_off);
468 468
469#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 469#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
470/** 470/**
471 * __ide_dma_host_on - Enable DMA on a host 471 * ide_dma_host_on - Enable DMA on a host
472 * @drive: drive to enable for DMA 472 * @drive: drive to enable for DMA
473 * 473 *
474 * Enable DMA on an IDE controller following generic bus mastering 474 * Enable DMA on an IDE controller following generic bus mastering
475 * IDE controller behaviour 475 * IDE controller behaviour
476 */ 476 */
477 477
478int __ide_dma_host_on (ide_drive_t *drive) 478void ide_dma_host_on(ide_drive_t *drive)
479{ 479{
480 if (drive->using_dma) { 480 if (drive->using_dma) {
481 ide_hwif_t *hwif = HWIF(drive); 481 ide_hwif_t *hwif = HWIF(drive);
@@ -483,12 +483,10 @@ int __ide_dma_host_on (ide_drive_t *drive)
483 u8 dma_stat = hwif->INB(hwif->dma_status); 483 u8 dma_stat = hwif->INB(hwif->dma_status);
484 484
485 hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status); 485 hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status);
486 return 0;
487 } 486 }
488 return 1;
489} 487}
490 488
491EXPORT_SYMBOL(__ide_dma_host_on); 489EXPORT_SYMBOL(ide_dma_host_on);
492 490
493/** 491/**
494 * __ide_dma_on - Enable DMA on a device 492 * __ide_dma_on - Enable DMA on a device
@@ -506,8 +504,7 @@ int __ide_dma_on (ide_drive_t *drive)
506 drive->using_dma = 1; 504 drive->using_dma = 1;
507 ide_toggle_bounce(drive, 1); 505 ide_toggle_bounce(drive, 1);
508 506
509 if (HWIF(drive)->ide_dma_host_on(drive)) 507 drive->hwif->dma_host_on(drive);
510 return 1;
511 508
512 return 0; 509 return 0;
513} 510}
@@ -940,8 +937,8 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
940 hwif->dma_host_off = &ide_dma_host_off; 937 hwif->dma_host_off = &ide_dma_host_off;
941 if (!hwif->ide_dma_on) 938 if (!hwif->ide_dma_on)
942 hwif->ide_dma_on = &__ide_dma_on; 939 hwif->ide_dma_on = &__ide_dma_on;
943 if (!hwif->ide_dma_host_on) 940 if (!hwif->dma_host_on)
944 hwif->ide_dma_host_on = &__ide_dma_host_on; 941 hwif->dma_host_on = &ide_dma_host_on;
945 if (!hwif->ide_dma_check) 942 if (!hwif->ide_dma_check)
946 hwif->ide_dma_check = &__ide_dma_check; 943 hwif->ide_dma_check = &__ide_dma_check;
947 if (!hwif->dma_setup) 944 if (!hwif->dma_setup)
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 5ecdb11a3462..c67b3b1e6f4c 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -830,7 +830,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
830 830
831#ifdef CONFIG_BLK_DEV_IDEDMA 831#ifdef CONFIG_BLK_DEV_IDEDMA
832 if (speed >= XFER_SW_DMA_0) 832 if (speed >= XFER_SW_DMA_0)
833 hwif->ide_dma_host_on(drive); 833 hwif->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->dma_off_quietly(drive); 835 hwif->dma_off_quietly(drive);
836#endif 836#endif
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 6e146b54257d..b3c0818c5c6c 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -509,7 +509,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
509 hwif->dma_off_quietly = tmp_hwif->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->dma_host_on = tmp_hwif->dma_host_on;
513 hwif->dma_host_off = tmp_hwif->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;
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 266ef37a2807..0a59d5ef1599 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -438,15 +438,15 @@ static int auide_dma_test_irq(ide_drive_t *drive)
438 return 0; 438 return 0;
439} 439}
440 440
441static int auide_dma_host_on(ide_drive_t *drive) 441static void auide_dma_host_on(ide_drive_t *drive)
442{ 442{
443 return 0;
444} 443}
445 444
446static int auide_dma_on(ide_drive_t *drive) 445static int auide_dma_on(ide_drive_t *drive)
447{ 446{
448 drive->using_dma = 1; 447 drive->using_dma = 1;
449 return auide_dma_host_on(drive); 448
449 return 0;
450} 450}
451 451
452static void auide_dma_host_off(ide_drive_t *drive) 452static void auide_dma_host_off(ide_drive_t *drive)
@@ -731,7 +731,7 @@ static int au_ide_probe(struct device *dev)
731 hwif->dma_setup = &auide_dma_setup; 731 hwif->dma_setup = &auide_dma_setup;
732 hwif->ide_dma_test_irq = &auide_dma_test_irq; 732 hwif->ide_dma_test_irq = &auide_dma_test_irq;
733 hwif->dma_host_off = &auide_dma_host_off; 733 hwif->dma_host_off = &auide_dma_host_off;
734 hwif->ide_dma_host_on = &auide_dma_host_on; 734 hwif->dma_host_on = &auide_dma_host_on;
735 hwif->ide_dma_lostirq = &auide_dma_lostirq; 735 hwif->ide_dma_lostirq = &auide_dma_lostirq;
736 hwif->ide_dma_on = &auide_dma_on; 736 hwif->ide_dma_on = &auide_dma_on;
737 737
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index ed32be174200..2d48af32e3f4 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -101,7 +101,7 @@ static u8 atiixp_dma_2_pio(u8 xfer_rate) {
101 } 101 }
102} 102}
103 103
104static int atiixp_ide_dma_host_on(ide_drive_t *drive) 104static void atiixp_dma_host_on(ide_drive_t *drive)
105{ 105{
106 struct pci_dev *dev = drive->hwif->pci_dev; 106 struct pci_dev *dev = drive->hwif->pci_dev;
107 unsigned long flags; 107 unsigned long flags;
@@ -118,7 +118,7 @@ static int atiixp_ide_dma_host_on(ide_drive_t *drive)
118 118
119 spin_unlock_irqrestore(&atiixp_lock, flags); 119 spin_unlock_irqrestore(&atiixp_lock, flags);
120 120
121 return __ide_dma_host_on(drive); 121 ide_dma_host_on(drive);
122} 122}
123 123
124static void atiixp_dma_host_off(ide_drive_t *drive) 124static void atiixp_dma_host_off(ide_drive_t *drive)
@@ -305,7 +305,7 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
305 else 305 else
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->dma_host_on = &atiixp_dma_host_on;
309 hwif->dma_host_off = &atiixp_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)
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index d9aa20012fc0..fd09b295a69d 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -279,7 +279,7 @@ sgiioc4_ide_dma_on(ide_drive_t * drive)
279{ 279{
280 drive->using_dma = 1; 280 drive->using_dma = 1;
281 281
282 return HWIF(drive)->ide_dma_host_on(drive); 282 return 0;
283} 283}
284 284
285static void sgiioc4_dma_off_quietly(ide_drive_t *drive) 285static void sgiioc4_dma_off_quietly(ide_drive_t *drive)
@@ -307,13 +307,8 @@ sgiioc4_ide_dma_test_irq(ide_drive_t * drive)
307 return sgiioc4_checkirq(HWIF(drive)); 307 return sgiioc4_checkirq(HWIF(drive));
308} 308}
309 309
310static int 310static void sgiioc4_dma_host_on(ide_drive_t * drive)
311sgiioc4_ide_dma_host_on(ide_drive_t * drive)
312{ 311{
313 if (drive->using_dma)
314 return 0;
315
316 return 1;
317} 312}
318 313
319static void sgiioc4_dma_host_off(ide_drive_t * drive) 314static void sgiioc4_dma_host_off(ide_drive_t * drive)
@@ -610,7 +605,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
610 hwif->ide_dma_on = &sgiioc4_ide_dma_on; 605 hwif->ide_dma_on = &sgiioc4_ide_dma_on;
611 hwif->dma_off_quietly = &sgiioc4_dma_off_quietly; 606 hwif->dma_off_quietly = &sgiioc4_dma_off_quietly;
612 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; 607 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
613 hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on; 608 hwif->dma_host_on = &sgiioc4_dma_host_on;
614 hwif->dma_host_off = &sgiioc4_dma_host_off; 609 hwif->dma_host_off = &sgiioc4_dma_host_off;
615 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 610 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
616 hwif->ide_dma_timeout = &__ide_dma_timeout; 611 hwif->ide_dma_timeout = &__ide_dma_timeout;
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index d3bb247e9574..395d35253d5d 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1983,10 +1983,8 @@ static void pmac_ide_dma_host_off(ide_drive_t *drive)
1983{ 1983{
1984} 1984}
1985 1985
1986static int 1986static int pmac_ide_dma_host_on(ide_drive_t *drive)
1987pmac_ide_dma_host_on (ide_drive_t *drive)
1988{ 1987{
1989 return 0;
1990} 1988}
1991 1989
1992static int 1990static int
@@ -2041,7 +2039,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
2041 hwif->ide_dma_end = &pmac_ide_dma_end; 2039 hwif->ide_dma_end = &pmac_ide_dma_end;
2042 hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; 2040 hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq;
2043 hwif->dma_host_off = &pmac_ide_dma_host_off; 2041 hwif->dma_host_off = &pmac_ide_dma_host_off;
2044 hwif->ide_dma_host_on = &pmac_ide_dma_host_on; 2042 hwif->dma_host_on = &pmac_ide_dma_host_on;
2045 hwif->ide_dma_timeout = &__ide_dma_timeout; 2043 hwif->ide_dma_timeout = &__ide_dma_timeout;
2046 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; 2044 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
2047 2045