diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2007-07-09 17:17:54 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:54 -0400 |
commit | c283f5dbe31920ca70b80a594a97bfaa2a28be13 (patch) | |
tree | 891268bfec27d88bb9c5773026dcf950afe063d9 /drivers | |
parent | 841d2a9bf16471716ba3a5172d24aa40a2ea9398 (diff) |
ide: make void and rename ide_dma_timeout() method
Since ide_dma_timeout() method's result is discarded, make it return 'void'.
While at it, drop 'ide_' from the method's name, drop the '__' prefix from
the default method's name, and do some cleanups in this method driver-wise:
- in ide-dma.c, au1xxx-ide.c, and pdc202xx_old.c, define/use 'hwif' variable;
- in au1xxx-ide.c, get rid of commented out printk();
- in sl82c105.c, get rid of unnecessary variables.
Signed-off-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.c | 11 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 17 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 12 | ||||
-rw-r--r-- | drivers/ide/pci/hpt366.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 13 | ||||
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/sl82c105.c | 13 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 2 |
10 files changed, 41 insertions, 39 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 543f8b51f6b1..444a0b84f5bd 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -448,17 +448,16 @@ static int icside_dma_test_irq(ide_drive_t *drive) | |||
448 | ICS_ARCIN_V6_INTRSTAT_1)) & 1; | 448 | ICS_ARCIN_V6_INTRSTAT_1)) & 1; |
449 | } | 449 | } |
450 | 450 | ||
451 | static int icside_dma_timeout(ide_drive_t *drive) | 451 | static void icside_dma_timeout(ide_drive_t *drive) |
452 | { | 452 | { |
453 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); | 453 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); |
454 | 454 | ||
455 | if (icside_dma_test_irq(drive)) | 455 | if (icside_dma_test_irq(drive)) |
456 | return 0; | 456 | return; |
457 | 457 | ||
458 | ide_dump_status(drive, "DMA timeout", | 458 | ide_dump_status(drive, "DMA timeout", HWIF(drive)->INB(IDE_STATUS_REG)); |
459 | HWIF(drive)->INB(IDE_STATUS_REG)); | ||
460 | 459 | ||
461 | return icside_dma_end(drive); | 460 | icside_dma_end(drive); |
462 | } | 461 | } |
463 | 462 | ||
464 | static void icside_dma_lost_irq(ide_drive_t *drive) | 463 | static void icside_dma_lost_irq(ide_drive_t *drive) |
@@ -489,7 +488,7 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
489 | hwif->dma_start = icside_dma_start; | 488 | hwif->dma_start = icside_dma_start; |
490 | hwif->ide_dma_end = icside_dma_end; | 489 | hwif->ide_dma_end = icside_dma_end; |
491 | hwif->ide_dma_test_irq = icside_dma_test_irq; | 490 | hwif->ide_dma_test_irq = icside_dma_test_irq; |
492 | hwif->ide_dma_timeout = icside_dma_timeout; | 491 | hwif->dma_timeout = icside_dma_timeout; |
493 | hwif->dma_lost_irq = icside_dma_lost_irq; | 492 | hwif->dma_lost_irq = icside_dma_lost_irq; |
494 | 493 | ||
495 | hwif->drives[0].autodma = hwif->autodma; | 494 | hwif->drives[0].autodma = hwif->autodma; |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index ce322602982e..ca55bfa4ac74 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -857,16 +857,19 @@ void ide_dma_lost_irq (ide_drive_t *drive) | |||
857 | 857 | ||
858 | EXPORT_SYMBOL(ide_dma_lost_irq); | 858 | EXPORT_SYMBOL(ide_dma_lost_irq); |
859 | 859 | ||
860 | int __ide_dma_timeout (ide_drive_t *drive) | 860 | void ide_dma_timeout (ide_drive_t *drive) |
861 | { | 861 | { |
862 | ide_hwif_t *hwif = HWIF(drive); | ||
863 | |||
862 | printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name); | 864 | printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name); |
863 | if (HWIF(drive)->ide_dma_test_irq(drive)) | ||
864 | return 0; | ||
865 | 865 | ||
866 | return HWIF(drive)->ide_dma_end(drive); | 866 | if (hwif->ide_dma_test_irq(drive)) |
867 | return; | ||
868 | |||
869 | hwif->ide_dma_end(drive); | ||
867 | } | 870 | } |
868 | 871 | ||
869 | EXPORT_SYMBOL(__ide_dma_timeout); | 872 | EXPORT_SYMBOL(ide_dma_timeout); |
870 | 873 | ||
871 | /* | 874 | /* |
872 | * Needed for allowing full modular support of ide-driver | 875 | * Needed for allowing full modular support of ide-driver |
@@ -1017,8 +1020,8 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p | |||
1017 | hwif->ide_dma_end = &__ide_dma_end; | 1020 | hwif->ide_dma_end = &__ide_dma_end; |
1018 | if (!hwif->ide_dma_test_irq) | 1021 | if (!hwif->ide_dma_test_irq) |
1019 | hwif->ide_dma_test_irq = &__ide_dma_test_irq; | 1022 | hwif->ide_dma_test_irq = &__ide_dma_test_irq; |
1020 | if (!hwif->ide_dma_timeout) | 1023 | if (!hwif->dma_timeout) |
1021 | hwif->ide_dma_timeout = &__ide_dma_timeout; | 1024 | hwif->dma_timeout = &ide_dma_timeout; |
1022 | if (!hwif->dma_lost_irq) | 1025 | if (!hwif->dma_lost_irq) |
1023 | hwif->dma_lost_irq = &ide_dma_lost_irq; | 1026 | hwif->dma_lost_irq = &ide_dma_lost_irq; |
1024 | 1027 | ||
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 9f4f8878b551..c5b5011da56e 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1350,7 +1350,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
1350 | hwif->INB(IDE_STATUS_REG)); | 1350 | hwif->INB(IDE_STATUS_REG)); |
1351 | } else { | 1351 | } else { |
1352 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); | 1352 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); |
1353 | (void) hwif->ide_dma_timeout(drive); | 1353 | hwif->dma_timeout(drive); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | /* | 1356 | /* |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 8a8674d3223f..3717a329b43b 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -497,7 +497,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) | |||
497 | hwif->dma_host_on = tmp_hwif->dma_host_on; | 497 | hwif->dma_host_on = tmp_hwif->dma_host_on; |
498 | hwif->dma_host_off = tmp_hwif->dma_host_off; | 498 | hwif->dma_host_off = tmp_hwif->dma_host_off; |
499 | hwif->dma_lost_irq = tmp_hwif->dma_lost_irq; | 499 | hwif->dma_lost_irq = tmp_hwif->dma_lost_irq; |
500 | hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout; | 500 | hwif->dma_timeout = tmp_hwif->dma_timeout; |
501 | 501 | ||
502 | hwif->OUTB = tmp_hwif->OUTB; | 502 | hwif->OUTB = tmp_hwif->OUTB; |
503 | hwif->OUTBSYNC = tmp_hwif->OUTBSYNC; | 503 | hwif->OUTBSYNC = tmp_hwif->OUTBSYNC; |
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index e8935519edbe..405903c42ba1 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -488,16 +488,16 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de | |||
488 | 488 | ||
489 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) | 489 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) |
490 | 490 | ||
491 | static int auide_dma_timeout(ide_drive_t *drive) | 491 | static void auide_dma_timeout(ide_drive_t *drive) |
492 | { | 492 | { |
493 | // printk("%s\n", __FUNCTION__); | 493 | ide_hwif_t *hwif = HWIF(drive); |
494 | 494 | ||
495 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); | 495 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); |
496 | 496 | ||
497 | if (HWIF(drive)->ide_dma_test_irq(drive)) | 497 | if (hwif->ide_dma_test_irq(drive)) |
498 | return 0; | 498 | return; |
499 | 499 | ||
500 | return HWIF(drive)->ide_dma_end(drive); | 500 | hwif->ide_dma_end(drive); |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
@@ -720,7 +720,7 @@ static int au_ide_probe(struct device *dev) | |||
720 | 720 | ||
721 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | 721 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
722 | hwif->dma_off_quietly = &auide_dma_off_quietly; | 722 | hwif->dma_off_quietly = &auide_dma_off_quietly; |
723 | hwif->ide_dma_timeout = &auide_dma_timeout; | 723 | hwif->dma_timeout = &auide_dma_timeout; |
724 | 724 | ||
725 | hwif->ide_dma_check = &auide_dma_check; | 725 | hwif->ide_dma_check = &auide_dma_check; |
726 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; | 726 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 34d06dc7f2b2..65018814ed73 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -799,10 +799,10 @@ static int hpt370_ide_dma_end(ide_drive_t *drive) | |||
799 | return __ide_dma_end(drive); | 799 | return __ide_dma_end(drive); |
800 | } | 800 | } |
801 | 801 | ||
802 | static int hpt370_ide_dma_timeout(ide_drive_t *drive) | 802 | static void hpt370_dma_timeout(ide_drive_t *drive) |
803 | { | 803 | { |
804 | hpt370_irq_timeout(drive); | 804 | hpt370_irq_timeout(drive); |
805 | return __ide_dma_timeout(drive); | 805 | ide_dma_timeout(drive); |
806 | } | 806 | } |
807 | 807 | ||
808 | /* returns 1 if DMA IRQ issued, 0 otherwise */ | 808 | /* returns 1 if DMA IRQ issued, 0 otherwise */ |
@@ -1353,7 +1353,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) | |||
1353 | } else if (chip_type >= HPT370) { | 1353 | } else if (chip_type >= HPT370) { |
1354 | hwif->dma_start = &hpt370_ide_dma_start; | 1354 | hwif->dma_start = &hpt370_ide_dma_start; |
1355 | hwif->ide_dma_end = &hpt370_ide_dma_end; | 1355 | hwif->ide_dma_end = &hpt370_ide_dma_end; |
1356 | hwif->ide_dma_timeout = &hpt370_ide_dma_timeout; | 1356 | hwif->dma_timeout = &hpt370_dma_timeout; |
1357 | } else | 1357 | } else |
1358 | hwif->dma_lost_irq = &hpt366_dma_lost_irq; | 1358 | hwif->dma_lost_irq = &hpt366_dma_lost_irq; |
1359 | 1359 | ||
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 5013df84e971..ae628b86e18a 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -277,11 +277,14 @@ static void pdc202xx_dma_lost_irq(ide_drive_t *drive) | |||
277 | ide_dma_lost_irq(drive); | 277 | ide_dma_lost_irq(drive); |
278 | } | 278 | } |
279 | 279 | ||
280 | static int pdc202xx_ide_dma_timeout(ide_drive_t *drive) | 280 | static void pdc202xx_dma_timeout(ide_drive_t *drive) |
281 | { | 281 | { |
282 | if (HWIF(drive)->resetproc != NULL) | 282 | ide_hwif_t *hwif = HWIF(drive); |
283 | HWIF(drive)->resetproc(drive); | 283 | |
284 | return __ide_dma_timeout(drive); | 284 | if (hwif->resetproc != NULL) |
285 | hwif->resetproc(drive); | ||
286 | |||
287 | ide_dma_timeout(drive); | ||
285 | } | 288 | } |
286 | 289 | ||
287 | static void pdc202xx_reset_host (ide_hwif_t *hwif) | 290 | static void pdc202xx_reset_host (ide_hwif_t *hwif) |
@@ -351,7 +354,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) | |||
351 | 354 | ||
352 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; | 355 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; |
353 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; | 356 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; |
354 | hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout; | 357 | hwif->dma_timeout = &pdc202xx_dma_timeout; |
355 | 358 | ||
356 | if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { | 359 | if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { |
357 | if (!(hwif->udma_four)) | 360 | if (!(hwif->udma_four)) |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 53bee59264ef..d396b2929ed8 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -608,7 +608,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif) | |||
608 | hwif->dma_host_on = &sgiioc4_dma_host_on; | 608 | hwif->dma_host_on = &sgiioc4_dma_host_on; |
609 | hwif->dma_host_off = &sgiioc4_dma_host_off; | 609 | hwif->dma_host_off = &sgiioc4_dma_host_off; |
610 | hwif->dma_lost_irq = &sgiioc4_dma_lost_irq; | 610 | hwif->dma_lost_irq = &sgiioc4_dma_lost_irq; |
611 | hwif->ide_dma_timeout = &__ide_dma_timeout; | 611 | hwif->dma_timeout = &ide_dma_timeout; |
612 | 612 | ||
613 | hwif->INB = &sgiioc4_INB; | 613 | hwif->INB = &sgiioc4_INB; |
614 | } | 614 | } |
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 202ce4965b60..487879842af4 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c | |||
@@ -241,15 +241,12 @@ static void sl82c105_dma_start(ide_drive_t *drive) | |||
241 | ide_dma_start(drive); | 241 | ide_dma_start(drive); |
242 | } | 242 | } |
243 | 243 | ||
244 | static int sl82c105_ide_dma_timeout(ide_drive_t *drive) | 244 | static void sl82c105_dma_timeout(ide_drive_t *drive) |
245 | { | 245 | { |
246 | ide_hwif_t *hwif = HWIF(drive); | 246 | DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name)); |
247 | struct pci_dev *dev = hwif->pci_dev; | ||
248 | 247 | ||
249 | DBG(("sl82c105_ide_dma_timeout(drive:%s)\n", drive->name)); | 248 | sl82c105_reset_host(HWIF(drive)->pci_dev); |
250 | 249 | ide_dma_timeout(drive); | |
251 | sl82c105_reset_host(dev); | ||
252 | return __ide_dma_timeout(drive); | ||
253 | } | 250 | } |
254 | 251 | ||
255 | static int sl82c105_ide_dma_on(ide_drive_t *drive) | 252 | static int sl82c105_ide_dma_on(ide_drive_t *drive) |
@@ -440,7 +437,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) | |||
440 | hwif->dma_off_quietly = &sl82c105_dma_off_quietly; | 437 | hwif->dma_off_quietly = &sl82c105_dma_off_quietly; |
441 | hwif->dma_lost_irq = &sl82c105_dma_lost_irq; | 438 | hwif->dma_lost_irq = &sl82c105_dma_lost_irq; |
442 | hwif->dma_start = &sl82c105_dma_start; | 439 | hwif->dma_start = &sl82c105_dma_start; |
443 | hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; | 440 | hwif->dma_timeout = &sl82c105_dma_timeout; |
444 | 441 | ||
445 | if (!noautodma) | 442 | if (!noautodma) |
446 | hwif->autodma = 1; | 443 | hwif->autodma = 1; |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index ca72ad202ebc..f9bada093d19 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -2056,7 +2056,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) | |||
2056 | hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; | 2056 | hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; |
2057 | hwif->dma_host_off = &pmac_ide_dma_host_off; | 2057 | hwif->dma_host_off = &pmac_ide_dma_host_off; |
2058 | hwif->dma_host_on = &pmac_ide_dma_host_on; | 2058 | hwif->dma_host_on = &pmac_ide_dma_host_on; |
2059 | hwif->ide_dma_timeout = &__ide_dma_timeout; | 2059 | hwif->dma_timeout = &ide_dma_timeout; |
2060 | hwif->dma_lost_irq = &pmac_ide_dma_lost_irq; | 2060 | hwif->dma_lost_irq = &pmac_ide_dma_lost_irq; |
2061 | 2061 | ||
2062 | hwif->atapi_dma = 1; | 2062 | hwif->atapi_dma = 1; |