aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-07-09 17:17:54 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-09 17:17:54 -0400
commit841d2a9bf16471716ba3a5172d24aa40a2ea9398 (patch)
treef836d41ed70bf3efd6350c293c0c31a40ef4f900 /drivers
parentb740d8846e2e184909e9f74d4ad9d67ae0e084ea (diff)
ide: make void and rename ide_dma_lostirq() method
Since ide_dma_lostirq() method's result is discarded, make it return 'void'. While at it, rename the method to dma_lost_irq(), drop the '__' prefix from the default method's name, and do some cleanups in this method driver-wise: - in aec62xx.c, rename the method in accordance with other drivers, and get rid of unnecessary variables there; - in pdc202xx_old.c, define/use 'hwif' variable; - in sgiioc4.c, rearrange the code to call the resetproc() method directly. 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.c5
-rw-r--r--drivers/ide/ide-dma.c9
-rw-r--r--drivers/ide/ide-io.c2
-rw-r--r--drivers/ide/ide.c2
-rw-r--r--drivers/ide/mips/au1xxx-ide.c5
-rw-r--r--drivers/ide/pci/aec62xx.c10
-rw-r--r--drivers/ide/pci/hpt366.c6
-rw-r--r--drivers/ide/pci/pdc202xx_old.c13
-rw-r--r--drivers/ide/pci/sgiioc4.c18
-rw-r--r--drivers/ide/pci/sl82c105.c7
-rw-r--r--drivers/ide/ppc/pmac.c9
11 files changed, 39 insertions, 47 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 66f826252aee..543f8b51f6b1 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -461,10 +461,9 @@ static int icside_dma_timeout(ide_drive_t *drive)
461 return icside_dma_end(drive); 461 return icside_dma_end(drive);
462} 462}
463 463
464static int icside_dma_lostirq(ide_drive_t *drive) 464static void icside_dma_lost_irq(ide_drive_t *drive)
465{ 465{
466 printk(KERN_ERR "%s: IRQ lost\n", drive->name); 466 printk(KERN_ERR "%s: IRQ lost\n", drive->name);
467 return 1;
468} 467}
469 468
470static void icside_dma_init(ide_hwif_t *hwif) 469static void icside_dma_init(ide_hwif_t *hwif)
@@ -491,7 +490,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
491 hwif->ide_dma_end = icside_dma_end; 490 hwif->ide_dma_end = icside_dma_end;
492 hwif->ide_dma_test_irq = icside_dma_test_irq; 491 hwif->ide_dma_test_irq = icside_dma_test_irq;
493 hwif->ide_dma_timeout = icside_dma_timeout; 492 hwif->ide_dma_timeout = icside_dma_timeout;
494 hwif->ide_dma_lostirq = icside_dma_lostirq; 493 hwif->dma_lost_irq = icside_dma_lost_irq;
495 494
496 hwif->drives[0].autodma = hwif->autodma; 495 hwif->drives[0].autodma = hwif->autodma;
497 hwif->drives[1].autodma = hwif->autodma; 496 hwif->drives[1].autodma = hwif->autodma;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ead141e2db9e..ce322602982e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -850,13 +850,12 @@ int ide_set_dma(ide_drive_t *drive)
850EXPORT_SYMBOL_GPL(ide_set_dma); 850EXPORT_SYMBOL_GPL(ide_set_dma);
851 851
852#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 852#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
853int __ide_dma_lostirq (ide_drive_t *drive) 853void ide_dma_lost_irq (ide_drive_t *drive)
854{ 854{
855 printk("%s: DMA interrupt recovery\n", drive->name); 855 printk("%s: DMA interrupt recovery\n", drive->name);
856 return 1;
857} 856}
858 857
859EXPORT_SYMBOL(__ide_dma_lostirq); 858EXPORT_SYMBOL(ide_dma_lost_irq);
860 859
861int __ide_dma_timeout (ide_drive_t *drive) 860int __ide_dma_timeout (ide_drive_t *drive)
862{ 861{
@@ -1020,8 +1019,8 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
1020 hwif->ide_dma_test_irq = &__ide_dma_test_irq; 1019 hwif->ide_dma_test_irq = &__ide_dma_test_irq;
1021 if (!hwif->ide_dma_timeout) 1020 if (!hwif->ide_dma_timeout)
1022 hwif->ide_dma_timeout = &__ide_dma_timeout; 1021 hwif->ide_dma_timeout = &__ide_dma_timeout;
1023 if (!hwif->ide_dma_lostirq) 1022 if (!hwif->dma_lost_irq)
1024 hwif->ide_dma_lostirq = &__ide_dma_lostirq; 1023 hwif->dma_lost_irq = &ide_dma_lost_irq;
1025 1024
1026 if (hwif->chipset != ide_trm290) { 1025 if (hwif->chipset != ide_trm290) {
1027 u8 dma_stat = hwif->INB(hwif->dma_status); 1026 u8 dma_stat = hwif->INB(hwif->dma_status);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index bfe8f1b712ba..9f4f8878b551 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1466,7 +1466,7 @@ void ide_timer_expiry (unsigned long data)
1466 startstop = handler(drive); 1466 startstop = handler(drive);
1467 } else if (drive_is_ready(drive)) { 1467 } else if (drive_is_ready(drive)) {
1468 if (drive->waiting_for_dma) 1468 if (drive->waiting_for_dma)
1469 (void) hwgroup->hwif->ide_dma_lostirq(drive); 1469 hwgroup->hwif->dma_lost_irq(drive);
1470 (void)ide_ack_intr(hwif); 1470 (void)ide_ack_intr(hwif);
1471 printk(KERN_WARNING "%s: lost interrupt\n", drive->name); 1471 printk(KERN_WARNING "%s: lost interrupt\n", drive->name);
1472 startstop = handler(drive); 1472 startstop = handler(drive);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0cd76bf66833..8a8674d3223f 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -496,7 +496,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
496 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq; 496 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq;
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->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq; 499 hwif->dma_lost_irq = tmp_hwif->dma_lost_irq;
500 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout; 500 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout;
501 501
502 hwif->OUTB = tmp_hwif->OUTB; 502 hwif->OUTB = tmp_hwif->OUTB;
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index ca95e990862e..e8935519edbe 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -456,10 +456,9 @@ static void auide_dma_off_quietly(ide_drive_t *drive)
456 drive->using_dma = 0; 456 drive->using_dma = 0;
457} 457}
458 458
459static int auide_dma_lostirq(ide_drive_t *drive) 459static void auide_dma_lost_irq(ide_drive_t *drive)
460{ 460{
461 printk(KERN_ERR "%s: IRQ lost\n", drive->name); 461 printk(KERN_ERR "%s: IRQ lost\n", drive->name);
462 return 0;
463} 462}
464 463
465static void auide_ddma_tx_callback(int irq, void *param) 464static void auide_ddma_tx_callback(int irq, void *param)
@@ -731,7 +730,7 @@ static int au_ide_probe(struct device *dev)
731 hwif->ide_dma_test_irq = &auide_dma_test_irq; 730 hwif->ide_dma_test_irq = &auide_dma_test_irq;
732 hwif->dma_host_off = &auide_dma_host_off; 731 hwif->dma_host_off = &auide_dma_host_off;
733 hwif->dma_host_on = &auide_dma_host_on; 732 hwif->dma_host_on = &auide_dma_host_on;
734 hwif->ide_dma_lostirq = &auide_dma_lostirq; 733 hwif->dma_lost_irq = &auide_dma_lost_irq;
735 hwif->ide_dma_on = &auide_dma_on; 734 hwif->ide_dma_on = &auide_dma_on;
736 735
737 hwif->autodma = 1; 736 hwif->autodma = 1;
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index b173bc66ce1e..bed32d0eaa37 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -172,12 +172,9 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
172 return -1; 172 return -1;
173} 173}
174 174
175static int aec62xx_irq_timeout (ide_drive_t *drive) 175static void aec62xx_dma_lost_irq (ide_drive_t *drive)
176{ 176{
177 ide_hwif_t *hwif = HWIF(drive); 177 switch (HWIF(drive)->pci_dev->device) {
178 struct pci_dev *dev = hwif->pci_dev;
179
180 switch(dev->device) {
181 case PCI_DEVICE_ID_ARTOP_ATP860: 178 case PCI_DEVICE_ID_ARTOP_ATP860:
182 case PCI_DEVICE_ID_ARTOP_ATP860R: 179 case PCI_DEVICE_ID_ARTOP_ATP860R:
183 case PCI_DEVICE_ID_ARTOP_ATP865: 180 case PCI_DEVICE_ID_ARTOP_ATP865:
@@ -186,7 +183,6 @@ static int aec62xx_irq_timeout (ide_drive_t *drive)
186 default: 183 default:
187 break; 184 break;
188 } 185 }
189 return 0;
190} 186}
191 187
192static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) 188static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
@@ -254,7 +250,7 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
254 hwif->mwdma_mask = 0x07; 250 hwif->mwdma_mask = 0x07;
255 251
256 hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; 252 hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate;
257 hwif->ide_dma_lostirq = &aec62xx_irq_timeout; 253 hwif->dma_lost_irq = &aec62xx_dma_lost_irq;
258 254
259 if (!noautodma) 255 if (!noautodma)
260 hwif->autodma = 1; 256 hwif->autodma = 1;
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index c33d0b0f11c9..34d06dc7f2b2 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -737,7 +737,7 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
737 * This is specific to the HPT366 UDMA chipset 737 * This is specific to the HPT366 UDMA chipset
738 * by HighPoint|Triones Technologies, Inc. 738 * by HighPoint|Triones Technologies, Inc.
739 */ 739 */
740static int hpt366_ide_dma_lostirq(ide_drive_t *drive) 740static void hpt366_dma_lost_irq(ide_drive_t *drive)
741{ 741{
742 struct pci_dev *dev = HWIF(drive)->pci_dev; 742 struct pci_dev *dev = HWIF(drive)->pci_dev;
743 u8 mcr1 = 0, mcr3 = 0, scr1 = 0; 743 u8 mcr1 = 0, mcr3 = 0, scr1 = 0;
@@ -749,7 +749,7 @@ static int hpt366_ide_dma_lostirq(ide_drive_t *drive)
749 drive->name, __FUNCTION__, mcr1, mcr3, scr1); 749 drive->name, __FUNCTION__, mcr1, mcr3, scr1);
750 if (scr1 & 0x10) 750 if (scr1 & 0x10)
751 pci_write_config_byte(dev, 0x5a, scr1 & ~0x10); 751 pci_write_config_byte(dev, 0x5a, scr1 & ~0x10);
752 return __ide_dma_lostirq(drive); 752 ide_dma_lost_irq(drive);
753} 753}
754 754
755static void hpt370_clear_engine(ide_drive_t *drive) 755static void hpt370_clear_engine(ide_drive_t *drive)
@@ -1355,7 +1355,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
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->ide_dma_timeout = &hpt370_ide_dma_timeout;
1357 } else 1357 } else
1358 hwif->ide_dma_lostirq = &hpt366_ide_dma_lostirq; 1358 hwif->dma_lost_irq = &hpt366_dma_lost_irq;
1359 1359
1360 if (!noautodma) 1360 if (!noautodma)
1361 hwif->autodma = 1; 1361 hwif->autodma = 1;
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 23844687deea..5013df84e971 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -267,11 +267,14 @@ somebody_else:
267 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ 267 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
268} 268}
269 269
270static int pdc202xx_ide_dma_lostirq(ide_drive_t *drive) 270static void pdc202xx_dma_lost_irq(ide_drive_t *drive)
271{ 271{
272 if (HWIF(drive)->resetproc != NULL) 272 ide_hwif_t *hwif = HWIF(drive);
273 HWIF(drive)->resetproc(drive); 273
274 return __ide_dma_lostirq(drive); 274 if (hwif->resetproc != NULL)
275 hwif->resetproc(drive);
276
277 ide_dma_lost_irq(drive);
275} 278}
276 279
277static int pdc202xx_ide_dma_timeout(ide_drive_t *drive) 280static int pdc202xx_ide_dma_timeout(ide_drive_t *drive)
@@ -347,7 +350,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
347 hwif->err_stops_fifo = 1; 350 hwif->err_stops_fifo = 1;
348 351
349 hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; 352 hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate;
350 hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq; 353 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
351 hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout; 354 hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout;
352 355
353 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { 356 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) {
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index d3185e29a38e..53bee59264ef 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -316,14 +316,6 @@ static void sgiioc4_dma_host_off(ide_drive_t * drive)
316 sgiioc4_clearirq(drive); 316 sgiioc4_clearirq(drive);
317} 317}
318 318
319static int
320sgiioc4_ide_dma_lostirq(ide_drive_t * drive)
321{
322 HWIF(drive)->resetproc(drive);
323
324 return __ide_dma_lostirq(drive);
325}
326
327static void 319static void
328sgiioc4_resetproc(ide_drive_t * drive) 320sgiioc4_resetproc(ide_drive_t * drive)
329{ 321{
@@ -331,6 +323,14 @@ sgiioc4_resetproc(ide_drive_t * drive)
331 sgiioc4_clearirq(drive); 323 sgiioc4_clearirq(drive);
332} 324}
333 325
326static void
327sgiioc4_dma_lost_irq(ide_drive_t * drive)
328{
329 sgiioc4_resetproc(drive);
330
331 ide_dma_lost_irq(drive);
332}
333
334static u8 334static u8
335sgiioc4_INB(unsigned long port) 335sgiioc4_INB(unsigned long port)
336{ 336{
@@ -607,7 +607,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
607 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; 607 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
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->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 610 hwif->dma_lost_irq = &sgiioc4_dma_lost_irq;
611 hwif->ide_dma_timeout = &__ide_dma_timeout; 611 hwif->ide_dma_timeout = &__ide_dma_timeout;
612 612
613 hwif->INB = &sgiioc4_INB; 613 hwif->INB = &sgiioc4_INB;
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 7c383d9cc472..202ce4965b60 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -195,7 +195,7 @@ static inline void sl82c105_reset_host(struct pci_dev *dev)
195 * This function is called when the IDE timer expires, the drive 195 * This function is called when the IDE timer expires, the drive
196 * indicates that it is READY, and we were waiting for DMA to complete. 196 * indicates that it is READY, and we were waiting for DMA to complete.
197 */ 197 */
198static int sl82c105_ide_dma_lostirq(ide_drive_t *drive) 198static void sl82c105_dma_lost_irq(ide_drive_t *drive)
199{ 199{
200 ide_hwif_t *hwif = HWIF(drive); 200 ide_hwif_t *hwif = HWIF(drive);
201 struct pci_dev *dev = hwif->pci_dev; 201 struct pci_dev *dev = hwif->pci_dev;
@@ -222,9 +222,6 @@ static int sl82c105_ide_dma_lostirq(ide_drive_t *drive)
222 } 222 }
223 223
224 sl82c105_reset_host(dev); 224 sl82c105_reset_host(dev);
225
226 /* __ide_dma_lostirq would return 1, so we do as well */
227 return 1;
228} 225}
229 226
230/* 227/*
@@ -441,7 +438,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
441 hwif->ide_dma_check = &sl82c105_ide_dma_check; 438 hwif->ide_dma_check = &sl82c105_ide_dma_check;
442 hwif->ide_dma_on = &sl82c105_ide_dma_on; 439 hwif->ide_dma_on = &sl82c105_ide_dma_on;
443 hwif->dma_off_quietly = &sl82c105_dma_off_quietly; 440 hwif->dma_off_quietly = &sl82c105_dma_off_quietly;
444 hwif->ide_dma_lostirq = &sl82c105_ide_dma_lostirq; 441 hwif->dma_lost_irq = &sl82c105_dma_lost_irq;
445 hwif->dma_start = &sl82c105_dma_start; 442 hwif->dma_start = &sl82c105_dma_start;
446 hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; 443 hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout;
447 444
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 45fc36f0f219..ca72ad202ebc 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -2004,20 +2004,19 @@ static void pmac_ide_dma_host_on(ide_drive_t *drive)
2004{ 2004{
2005} 2005}
2006 2006
2007static int 2007static void
2008pmac_ide_dma_lostirq (ide_drive_t *drive) 2008pmac_ide_dma_lost_irq (ide_drive_t *drive)
2009{ 2009{
2010 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; 2010 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
2011 volatile struct dbdma_regs __iomem *dma; 2011 volatile struct dbdma_regs __iomem *dma;
2012 unsigned long status; 2012 unsigned long status;
2013 2013
2014 if (pmif == NULL) 2014 if (pmif == NULL)
2015 return 0; 2015 return;
2016 dma = pmif->dma_regs; 2016 dma = pmif->dma_regs;
2017 2017
2018 status = readl(&dma->status); 2018 status = readl(&dma->status);
2019 printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status); 2019 printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status);
2020 return 0;
2021} 2020}
2022 2021
2023/* 2022/*
@@ -2058,7 +2057,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
2058 hwif->dma_host_off = &pmac_ide_dma_host_off; 2057 hwif->dma_host_off = &pmac_ide_dma_host_off;
2059 hwif->dma_host_on = &pmac_ide_dma_host_on; 2058 hwif->dma_host_on = &pmac_ide_dma_host_on;
2060 hwif->ide_dma_timeout = &__ide_dma_timeout; 2059 hwif->ide_dma_timeout = &__ide_dma_timeout;
2061 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; 2060 hwif->dma_lost_irq = &pmac_ide_dma_lost_irq;
2062 2061
2063 hwif->atapi_dma = 1; 2062 hwif->atapi_dma = 1;
2064 switch(pmif->kind) { 2063 switch(pmif->kind) {