diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:50 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:50 -0400 |
commit | b2f951aabc9cc7d5fb987aeec9aef96ccce618a5 (patch) | |
tree | d388e9a44a153cee8395bd7ca9eff63492ff9cfd /drivers/ide/ide-dma.c | |
parent | c97c6aca75fd5f718056fde7cff798b8cbdb07c0 (diff) |
ide: add ->read_sff_dma_status method
Add ->read_sff_dma_status method for reading DMA Status register
and use it instead of ->INB.
While at it:
* Use inb() directly in ns87415.c::ns87415_dma_end().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 7ee44f86bc54..ebddedde24af 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -334,7 +334,7 @@ static int config_drive_for_dma (ide_drive_t *drive) | |||
334 | static int dma_timer_expiry (ide_drive_t *drive) | 334 | static int dma_timer_expiry (ide_drive_t *drive) |
335 | { | 335 | { |
336 | ide_hwif_t *hwif = HWIF(drive); | 336 | ide_hwif_t *hwif = HWIF(drive); |
337 | u8 dma_stat = hwif->INB(hwif->dma_status); | 337 | u8 dma_stat = hwif->read_sff_dma_status(hwif); |
338 | 338 | ||
339 | printk(KERN_WARNING "%s: dma_timer_expiry: dma status == 0x%02x\n", | 339 | printk(KERN_WARNING "%s: dma_timer_expiry: dma status == 0x%02x\n", |
340 | drive->name, dma_stat); | 340 | drive->name, dma_stat); |
@@ -369,7 +369,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on) | |||
369 | { | 369 | { |
370 | ide_hwif_t *hwif = HWIF(drive); | 370 | ide_hwif_t *hwif = HWIF(drive); |
371 | u8 unit = (drive->select.b.unit & 0x01); | 371 | u8 unit = (drive->select.b.unit & 0x01); |
372 | u8 dma_stat = hwif->INB(hwif->dma_status); | 372 | u8 dma_stat = hwif->read_sff_dma_status(hwif); |
373 | 373 | ||
374 | if (on) | 374 | if (on) |
375 | dma_stat |= (1 << (5 + unit)); | 375 | dma_stat |= (1 << (5 + unit)); |
@@ -472,8 +472,8 @@ int ide_dma_setup(ide_drive_t *drive) | |||
472 | /* specify r/w */ | 472 | /* specify r/w */ |
473 | hwif->OUTB(reading, hwif->dma_command); | 473 | hwif->OUTB(reading, hwif->dma_command); |
474 | 474 | ||
475 | /* read dma_status for INTR & ERROR flags */ | 475 | /* read DMA status for INTR & ERROR flags */ |
476 | dma_stat = hwif->INB(hwif->dma_status); | 476 | dma_stat = hwif->read_sff_dma_status(hwif); |
477 | 477 | ||
478 | /* clear INTR & ERROR flags */ | 478 | /* clear INTR & ERROR flags */ |
479 | hwif->OUTB(dma_stat|6, hwif->dma_status); | 479 | hwif->OUTB(dma_stat|6, hwif->dma_status); |
@@ -520,7 +520,7 @@ int __ide_dma_end (ide_drive_t *drive) | |||
520 | /* stop DMA */ | 520 | /* stop DMA */ |
521 | hwif->OUTB(dma_cmd&~1, hwif->dma_command); | 521 | hwif->OUTB(dma_cmd&~1, hwif->dma_command); |
522 | /* get DMA status */ | 522 | /* get DMA status */ |
523 | dma_stat = hwif->INB(hwif->dma_status); | 523 | dma_stat = hwif->read_sff_dma_status(hwif); |
524 | /* clear the INTR & ERROR bits */ | 524 | /* clear the INTR & ERROR bits */ |
525 | hwif->OUTB(dma_stat|6, hwif->dma_status); | 525 | hwif->OUTB(dma_stat|6, hwif->dma_status); |
526 | /* purge DMA mappings */ | 526 | /* purge DMA mappings */ |
@@ -537,7 +537,7 @@ EXPORT_SYMBOL(__ide_dma_end); | |||
537 | int ide_dma_test_irq(ide_drive_t *drive) | 537 | int ide_dma_test_irq(ide_drive_t *drive) |
538 | { | 538 | { |
539 | ide_hwif_t *hwif = HWIF(drive); | 539 | ide_hwif_t *hwif = HWIF(drive); |
540 | u8 dma_stat = hwif->INB(hwif->dma_status); | 540 | u8 dma_stat = hwif->read_sff_dma_status(hwif); |
541 | 541 | ||
542 | /* return 1 if INTR asserted */ | 542 | /* return 1 if INTR asserted */ |
543 | if ((dma_stat & 4) == 4) | 543 | if ((dma_stat & 4) == 4) |