aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
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/ide/pci
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/ide/pci')
-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
5 files changed, 25 insertions, 29 deletions
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