diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:52 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:52 -0400 |
commit | b73c7ee25da6133f97f47ffd3557288417da7c76 (patch) | |
tree | 0d348c81294d246b8417aff6e24502c93b312505 /drivers/ide | |
parent | c6dfa867bb45f4bff2e48f3bc89ab1d6a7ab4c21 (diff) |
ide: add ->read_status method
* Remove ide_read_status() inline helper.
* Add ->read_status method for reading ATA Status register
and use it instead of ->INB.
While at it:
* Don't use HWGROUP() macro.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/arm/icside.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-atapi.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 5 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 19 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 33 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 22 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 23 | ||||
-rw-r--r-- | drivers/ide/pci/ns87415.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/scc_pata.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 19 |
13 files changed, 101 insertions, 61 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 850fe9342a1f..f73422dd8474 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -375,12 +375,14 @@ static int icside_dma_test_irq(ide_drive_t *drive) | |||
375 | 375 | ||
376 | static void icside_dma_timeout(ide_drive_t *drive) | 376 | static void icside_dma_timeout(ide_drive_t *drive) |
377 | { | 377 | { |
378 | ide_hwif_t *hwif = drive->hwif; | ||
379 | |||
378 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); | 380 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); |
379 | 381 | ||
380 | if (icside_dma_test_irq(drive)) | 382 | if (icside_dma_test_irq(drive)) |
381 | return; | 383 | return; |
382 | 384 | ||
383 | ide_dump_status(drive, "DMA timeout", ide_read_status(drive)); | 385 | ide_dump_status(drive, "DMA timeout", hwif->read_status(hwif)); |
384 | 386 | ||
385 | icside_dma_end(drive); | 387 | icside_dma_end(drive); |
386 | } | 388 | } |
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 2802031de670..6554c4225a05 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -35,7 +35,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
35 | } | 35 | } |
36 | 36 | ||
37 | /* Clear the interrupt */ | 37 | /* Clear the interrupt */ |
38 | stat = ide_read_status(drive); | 38 | stat = hwif->read_status(hwif); |
39 | 39 | ||
40 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | 40 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { |
41 | if (hwif->dma_ops->dma_end(drive) || | 41 | if (hwif->dma_ops->dma_end(drive) || |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 6e29dd532090..82879a1a89e5 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -280,11 +280,12 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st) | |||
280 | */ | 280 | */ |
281 | static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | 281 | static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) |
282 | { | 282 | { |
283 | struct request *rq = HWGROUP(drive)->rq; | 283 | ide_hwif_t *hwif = drive->hwif; |
284 | struct request *rq = hwif->hwgroup->rq; | ||
284 | int stat, err, sense_key; | 285 | int stat, err, sense_key; |
285 | 286 | ||
286 | /* check for errors */ | 287 | /* check for errors */ |
287 | stat = ide_read_status(drive); | 288 | stat = hwif->read_status(hwif); |
288 | 289 | ||
289 | if (stat_ret) | 290 | if (stat_ret) |
290 | *stat_ret = stat; | 291 | *stat_ret = stat; |
@@ -606,6 +607,8 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
606 | static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | 607 | static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, |
607 | int len, int ireason, int rw) | 608 | int len, int ireason, int rw) |
608 | { | 609 | { |
610 | ide_hwif_t *hwif = drive->hwif; | ||
611 | |||
609 | /* | 612 | /* |
610 | * ireason == 0: the drive wants to receive data from us | 613 | * ireason == 0: the drive wants to receive data from us |
611 | * ireason == 2: the drive is expecting to transfer data to us | 614 | * ireason == 2: the drive is expecting to transfer data to us |
@@ -624,7 +627,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
624 | * Some drives (ASUS) seem to tell us that status info is | 627 | * Some drives (ASUS) seem to tell us that status info is |
625 | * available. Just get it and ignore. | 628 | * available. Just get it and ignore. |
626 | */ | 629 | */ |
627 | (void)ide_read_status(drive); | 630 | (void)hwif->read_status(hwif); |
628 | return 0; | 631 | return 0; |
629 | } else { | 632 | } else { |
630 | /* drive wants a command packet, or invalid ireason... */ | 633 | /* drive wants a command packet, or invalid ireason... */ |
@@ -1199,8 +1202,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1199 | 1202 | ||
1200 | if (blk_fs_request(rq)) { | 1203 | if (blk_fs_request(rq)) { |
1201 | if (info->cd_flags & IDE_CD_FLAG_SEEKING) { | 1204 | if (info->cd_flags & IDE_CD_FLAG_SEEKING) { |
1205 | ide_hwif_t *hwif = drive->hwif; | ||
1202 | unsigned long elapsed = jiffies - info->start_seek; | 1206 | unsigned long elapsed = jiffies - info->start_seek; |
1203 | int stat = ide_read_status(drive); | 1207 | int stat = hwif->read_status(hwif); |
1204 | 1208 | ||
1205 | if ((stat & SEEK_STAT) != SEEK_STAT) { | 1209 | if ((stat & SEEK_STAT) != SEEK_STAT) { |
1206 | if (elapsed < IDECD_SEEK_TIMEOUT) { | 1210 | if (elapsed < IDECD_SEEK_TIMEOUT) { |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index ac342ebf6c54..ecf60dbbe3e9 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -100,10 +100,11 @@ static const struct drive_list_entry drive_blacklist [] = { | |||
100 | 100 | ||
101 | ide_startstop_t ide_dma_intr (ide_drive_t *drive) | 101 | ide_startstop_t ide_dma_intr (ide_drive_t *drive) |
102 | { | 102 | { |
103 | ide_hwif_t *hwif = drive->hwif; | ||
103 | u8 stat = 0, dma_stat = 0; | 104 | u8 stat = 0, dma_stat = 0; |
104 | 105 | ||
105 | dma_stat = drive->hwif->dma_ops->dma_end(drive); | 106 | dma_stat = hwif->dma_ops->dma_end(drive); |
106 | stat = ide_read_status(drive); | 107 | stat = hwif->read_status(hwif); |
107 | 108 | ||
108 | if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { | 109 | if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { |
109 | if (!dma_stat) { | 110 | if (!dma_stat) { |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 011d72011cc4..6f5294cfff23 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -949,11 +949,12 @@ static int idefloppy_get_format_progress(ide_drive_t *drive, int __user *arg) | |||
949 | 949 | ||
950 | /* Else assume format_unit has finished, and we're at 0x10000 */ | 950 | /* Else assume format_unit has finished, and we're at 0x10000 */ |
951 | } else { | 951 | } else { |
952 | ide_hwif_t *hwif = drive->hwif; | ||
952 | unsigned long flags; | 953 | unsigned long flags; |
953 | u8 stat; | 954 | u8 stat; |
954 | 955 | ||
955 | local_irq_save(flags); | 956 | local_irq_save(flags); |
956 | stat = ide_read_status(drive); | 957 | stat = hwif->read_status(hwif); |
957 | local_irq_restore(flags); | 958 | local_irq_restore(flags); |
958 | 959 | ||
959 | progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000; | 960 | progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000; |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index ca0c04a919cb..fdc221ce9920 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -381,8 +381,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
381 | if (err == ABRT_ERR) { | 381 | if (err == ABRT_ERR) { |
382 | if (drive->select.b.lba && | 382 | if (drive->select.b.lba && |
383 | /* some newer drives don't support WIN_SPECIFY */ | 383 | /* some newer drives don't support WIN_SPECIFY */ |
384 | hwif->INB(hwif->io_ports.command_addr) == | 384 | hwif->read_status(hwif) == WIN_SPECIFY) |
385 | WIN_SPECIFY) | ||
386 | return ide_stopped; | 385 | return ide_stopped; |
387 | } else if ((err & BAD_CRC) == BAD_CRC) { | 386 | } else if ((err & BAD_CRC) == BAD_CRC) { |
388 | /* UDMA crc error, just retry the operation */ | 387 | /* UDMA crc error, just retry the operation */ |
@@ -408,7 +407,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
408 | return ide_stopped; | 407 | return ide_stopped; |
409 | } | 408 | } |
410 | 409 | ||
411 | if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) | 410 | if (hwif->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) |
412 | rq->errors |= ERROR_RESET; | 411 | rq->errors |= ERROR_RESET; |
413 | 412 | ||
414 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { | 413 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { |
@@ -435,7 +434,7 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, u | |||
435 | /* add decoding error stuff */ | 434 | /* add decoding error stuff */ |
436 | } | 435 | } |
437 | 436 | ||
438 | if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) | 437 | if (hwif->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) |
439 | /* force an abort */ | 438 | /* force an abort */ |
440 | hwif->exec_command(hwif, WIN_IDLEIMMEDIATE); | 439 | hwif->exec_command(hwif, WIN_IDLEIMMEDIATE); |
441 | 440 | ||
@@ -711,7 +710,8 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
711 | #ifdef DEBUG | 710 | #ifdef DEBUG |
712 | printk("%s: DRIVE_CMD (null)\n", drive->name); | 711 | printk("%s: DRIVE_CMD (null)\n", drive->name); |
713 | #endif | 712 | #endif |
714 | ide_end_drive_cmd(drive, ide_read_status(drive), ide_read_error(drive)); | 713 | ide_end_drive_cmd(drive, hwif->read_status(hwif), |
714 | ide_read_error(drive)); | ||
715 | 715 | ||
716 | return ide_stopped; | 716 | return ide_stopped; |
717 | } | 717 | } |
@@ -1141,7 +1141,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
1141 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); | 1141 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); |
1142 | (void)hwif->dma_ops->dma_end(drive); | 1142 | (void)hwif->dma_ops->dma_end(drive); |
1143 | ret = ide_error(drive, "dma timeout error", | 1143 | ret = ide_error(drive, "dma timeout error", |
1144 | ide_read_status(drive)); | 1144 | hwif->read_status(hwif)); |
1145 | } else { | 1145 | } else { |
1146 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); | 1146 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); |
1147 | hwif->dma_ops->dma_timeout(drive); | 1147 | hwif->dma_ops->dma_timeout(drive); |
@@ -1266,7 +1266,7 @@ void ide_timer_expiry (unsigned long data) | |||
1266 | } else | 1266 | } else |
1267 | startstop = | 1267 | startstop = |
1268 | ide_error(drive, "irq timeout", | 1268 | ide_error(drive, "irq timeout", |
1269 | ide_read_status(drive)); | 1269 | hwif->read_status(hwif)); |
1270 | } | 1270 | } |
1271 | drive->service_time = jiffies - drive->service_start; | 1271 | drive->service_time = jiffies - drive->service_start; |
1272 | spin_lock_irq(&ide_lock); | 1272 | spin_lock_irq(&ide_lock); |
@@ -1322,7 +1322,8 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) | |||
1322 | */ | 1322 | */ |
1323 | do { | 1323 | do { |
1324 | if (hwif->irq == irq) { | 1324 | if (hwif->irq == irq) { |
1325 | stat = hwif->INB(hwif->io_ports.status_addr); | 1325 | stat = hwif->read_status(hwif); |
1326 | |||
1326 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { | 1327 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { |
1327 | /* Try to not flood the console with msgs */ | 1328 | /* Try to not flood the console with msgs */ |
1328 | static unsigned long last_msgtime, count; | 1329 | static unsigned long last_msgtime, count; |
@@ -1412,7 +1413,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) | |||
1412 | * Whack the status register, just in case | 1413 | * Whack the status register, just in case |
1413 | * we have a leftover pending IRQ. | 1414 | * we have a leftover pending IRQ. |
1414 | */ | 1415 | */ |
1415 | (void) hwif->INB(hwif->io_ports.status_addr); | 1416 | (void)hwif->read_status(hwif); |
1416 | #endif /* CONFIG_BLK_DEV_IDEPCI */ | 1417 | #endif /* CONFIG_BLK_DEV_IDEPCI */ |
1417 | } | 1418 | } |
1418 | spin_unlock_irqrestore(&ide_lock, flags); | 1419 | spin_unlock_irqrestore(&ide_lock, flags); |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index d8db25581909..086eceaeeafd 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -111,6 +111,14 @@ static void ide_exec_command(ide_hwif_t *hwif, u8 cmd) | |||
111 | outb(cmd, hwif->io_ports.command_addr); | 111 | outb(cmd, hwif->io_ports.command_addr); |
112 | } | 112 | } |
113 | 113 | ||
114 | static u8 ide_read_status(ide_hwif_t *hwif) | ||
115 | { | ||
116 | if (hwif->host_flags & IDE_HFLAG_MMIO) | ||
117 | return readb((void __iomem *)hwif->io_ports.status_addr); | ||
118 | else | ||
119 | return inb(hwif->io_ports.status_addr); | ||
120 | } | ||
121 | |||
114 | static u8 ide_read_sff_dma_status(ide_hwif_t *hwif) | 122 | static u8 ide_read_sff_dma_status(ide_hwif_t *hwif) |
115 | { | 123 | { |
116 | if (hwif->host_flags & IDE_HFLAG_MMIO) | 124 | if (hwif->host_flags & IDE_HFLAG_MMIO) |
@@ -340,6 +348,7 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq, | |||
340 | void default_hwif_transport(ide_hwif_t *hwif) | 348 | void default_hwif_transport(ide_hwif_t *hwif) |
341 | { | 349 | { |
342 | hwif->exec_command = ide_exec_command; | 350 | hwif->exec_command = ide_exec_command; |
351 | hwif->read_status = ide_read_status; | ||
343 | hwif->read_sff_dma_status = ide_read_sff_dma_status; | 352 | hwif->read_sff_dma_status = ide_read_sff_dma_status; |
344 | 353 | ||
345 | hwif->tf_load = ide_tf_load; | 354 | hwif->tf_load = ide_tf_load; |
@@ -505,7 +514,7 @@ int drive_is_ready (ide_drive_t *drive) | |||
505 | stat = ide_read_altstatus(drive); | 514 | stat = ide_read_altstatus(drive); |
506 | else | 515 | else |
507 | /* Note: this may clear a pending IRQ!! */ | 516 | /* Note: this may clear a pending IRQ!! */ |
508 | stat = ide_read_status(drive); | 517 | stat = hwif->read_status(hwif); |
509 | 518 | ||
510 | if (stat & BUSY_STAT) | 519 | if (stat & BUSY_STAT) |
511 | /* drive busy: definitely not interrupting */ | 520 | /* drive busy: definitely not interrupting */ |
@@ -530,24 +539,25 @@ EXPORT_SYMBOL(drive_is_ready); | |||
530 | */ | 539 | */ |
531 | static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long timeout, u8 *rstat) | 540 | static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long timeout, u8 *rstat) |
532 | { | 541 | { |
542 | ide_hwif_t *hwif = drive->hwif; | ||
533 | unsigned long flags; | 543 | unsigned long flags; |
534 | int i; | 544 | int i; |
535 | u8 stat; | 545 | u8 stat; |
536 | 546 | ||
537 | udelay(1); /* spec allows drive 400ns to assert "BUSY" */ | 547 | udelay(1); /* spec allows drive 400ns to assert "BUSY" */ |
538 | stat = ide_read_status(drive); | 548 | stat = hwif->read_status(hwif); |
539 | 549 | ||
540 | if (stat & BUSY_STAT) { | 550 | if (stat & BUSY_STAT) { |
541 | local_irq_set(flags); | 551 | local_irq_set(flags); |
542 | timeout += jiffies; | 552 | timeout += jiffies; |
543 | while ((stat = ide_read_status(drive)) & BUSY_STAT) { | 553 | while ((stat = hwif->read_status(hwif)) & BUSY_STAT) { |
544 | if (time_after(jiffies, timeout)) { | 554 | if (time_after(jiffies, timeout)) { |
545 | /* | 555 | /* |
546 | * One last read after the timeout in case | 556 | * One last read after the timeout in case |
547 | * heavy interrupt load made us not make any | 557 | * heavy interrupt load made us not make any |
548 | * progress during the timeout.. | 558 | * progress during the timeout.. |
549 | */ | 559 | */ |
550 | stat = ide_read_status(drive); | 560 | stat = hwif->read_status(hwif); |
551 | if (!(stat & BUSY_STAT)) | 561 | if (!(stat & BUSY_STAT)) |
552 | break; | 562 | break; |
553 | 563 | ||
@@ -567,7 +577,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti | |||
567 | */ | 577 | */ |
568 | for (i = 0; i < 10; i++) { | 578 | for (i = 0; i < 10; i++) { |
569 | udelay(1); | 579 | udelay(1); |
570 | stat = ide_read_status(drive); | 580 | stat = hwif->read_status(hwif); |
571 | 581 | ||
572 | if (OK_STAT(stat, good, bad)) { | 582 | if (OK_STAT(stat, good, bad)) { |
573 | *rstat = stat; | 583 | *rstat = stat; |
@@ -718,7 +728,7 @@ int ide_driveid_update(ide_drive_t *drive) | |||
718 | } while (stat & BUSY_STAT); | 728 | } while (stat & BUSY_STAT); |
719 | 729 | ||
720 | msleep(50); /* wait for IRQ and DRQ_STAT */ | 730 | msleep(50); /* wait for IRQ and DRQ_STAT */ |
721 | stat = ide_read_status(drive); | 731 | stat = hwif->read_status(hwif); |
722 | 732 | ||
723 | if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) { | 733 | if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) { |
724 | SELECT_MASK(drive, 0); | 734 | SELECT_MASK(drive, 0); |
@@ -733,7 +743,7 @@ int ide_driveid_update(ide_drive_t *drive) | |||
733 | return 0; | 743 | return 0; |
734 | } | 744 | } |
735 | hwif->input_data(drive, NULL, id, SECTOR_SIZE); | 745 | hwif->input_data(drive, NULL, id, SECTOR_SIZE); |
736 | (void)ide_read_status(drive); /* clear drive IRQ */ | 746 | (void)hwif->read_status(hwif); /* clear drive IRQ */ |
737 | local_irq_enable(); | 747 | local_irq_enable(); |
738 | local_irq_restore(flags); | 748 | local_irq_restore(flags); |
739 | ide_fix_driveid(id); | 749 | ide_fix_driveid(id); |
@@ -943,12 +953,13 @@ static ide_startstop_t do_reset1 (ide_drive_t *, int); | |||
943 | */ | 953 | */ |
944 | static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive) | 954 | static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive) |
945 | { | 955 | { |
946 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 956 | ide_hwif_t *hwif = drive->hwif; |
957 | ide_hwgroup_t *hwgroup = hwif->hwgroup; | ||
947 | u8 stat; | 958 | u8 stat; |
948 | 959 | ||
949 | SELECT_DRIVE(drive); | 960 | SELECT_DRIVE(drive); |
950 | udelay (10); | 961 | udelay (10); |
951 | stat = ide_read_status(drive); | 962 | stat = hwif->read_status(hwif); |
952 | 963 | ||
953 | if (OK_STAT(stat, 0, BUSY_STAT)) | 964 | if (OK_STAT(stat, 0, BUSY_STAT)) |
954 | printk("%s: ATAPI reset complete\n", drive->name); | 965 | printk("%s: ATAPI reset complete\n", drive->name); |
@@ -994,7 +1005,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) | |||
994 | } | 1005 | } |
995 | } | 1006 | } |
996 | 1007 | ||
997 | tmp = ide_read_status(drive); | 1008 | tmp = hwif->read_status(hwif); |
998 | 1009 | ||
999 | if (!OK_STAT(tmp, 0, BUSY_STAT)) { | 1010 | if (!OK_STAT(tmp, 0, BUSY_STAT)) { |
1000 | if (time_before(jiffies, hwgroup->poll_timeout)) { | 1011 | if (time_before(jiffies, hwgroup->poll_timeout)) { |
@@ -1208,7 +1219,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) | |||
1208 | * about locking issues (2.5 work ?). | 1219 | * about locking issues (2.5 work ?). |
1209 | */ | 1220 | */ |
1210 | mdelay(1); | 1221 | mdelay(1); |
1211 | stat = hwif->INB(hwif->io_ports.status_addr); | 1222 | stat = hwif->read_status(hwif); |
1212 | if ((stat & BUSY_STAT) == 0) | 1223 | if ((stat & BUSY_STAT) == 0) |
1213 | return 0; | 1224 | return 0; |
1214 | /* | 1225 | /* |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index d1e834a1c5cd..c42fcfedcbf6 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -276,7 +276,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
276 | 276 | ||
277 | if (io_ports->ctl_addr) { | 277 | if (io_ports->ctl_addr) { |
278 | a = ide_read_altstatus(drive); | 278 | a = ide_read_altstatus(drive); |
279 | s = ide_read_status(drive); | 279 | s = hwif->read_status(hwif); |
280 | if ((a ^ s) & ~INDEX_STAT) | 280 | if ((a ^ s) & ~INDEX_STAT) |
281 | /* ancient Seagate drives, broken interfaces */ | 281 | /* ancient Seagate drives, broken interfaces */ |
282 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " | 282 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " |
@@ -307,12 +307,12 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
307 | /* give drive a breather */ | 307 | /* give drive a breather */ |
308 | msleep(50); | 308 | msleep(50); |
309 | s = use_altstatus ? ide_read_altstatus(drive) | 309 | s = use_altstatus ? ide_read_altstatus(drive) |
310 | : ide_read_status(drive); | 310 | : hwif->read_status(hwif); |
311 | } while (s & BUSY_STAT); | 311 | } while (s & BUSY_STAT); |
312 | 312 | ||
313 | /* wait for IRQ and DRQ_STAT */ | 313 | /* wait for IRQ and DRQ_STAT */ |
314 | msleep(50); | 314 | msleep(50); |
315 | s = ide_read_status(drive); | 315 | s = hwif->read_status(hwif); |
316 | 316 | ||
317 | if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) { | 317 | if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) { |
318 | unsigned long flags; | 318 | unsigned long flags; |
@@ -324,7 +324,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
324 | /* drive responded with ID */ | 324 | /* drive responded with ID */ |
325 | rc = 0; | 325 | rc = 0; |
326 | /* clear drive IRQ */ | 326 | /* clear drive IRQ */ |
327 | (void)ide_read_status(drive); | 327 | (void)hwif->read_status(hwif); |
328 | local_irq_restore(flags); | 328 | local_irq_restore(flags); |
329 | } else { | 329 | } else { |
330 | /* drive refused ID */ | 330 | /* drive refused ID */ |
@@ -371,7 +371,7 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd) | |||
371 | 371 | ||
372 | ide_set_irq(drive, 0); | 372 | ide_set_irq(drive, 0); |
373 | /* clear drive IRQ */ | 373 | /* clear drive IRQ */ |
374 | (void)ide_read_status(drive); | 374 | (void)hwif->read_status(hwif); |
375 | udelay(5); | 375 | udelay(5); |
376 | irq = probe_irq_off(cookie); | 376 | irq = probe_irq_off(cookie); |
377 | if (!hwif->irq) { | 377 | if (!hwif->irq) { |
@@ -396,7 +396,7 @@ static int ide_busy_sleep(ide_hwif_t *hwif) | |||
396 | 396 | ||
397 | do { | 397 | do { |
398 | msleep(50); | 398 | msleep(50); |
399 | stat = hwif->INB(hwif->io_ports.status_addr); | 399 | stat = hwif->read_status(hwif); |
400 | if ((stat & BUSY_STAT) == 0) | 400 | if ((stat & BUSY_STAT) == 0) |
401 | return 0; | 401 | return 0; |
402 | } while (time_before(jiffies, timeout)); | 402 | } while (time_before(jiffies, timeout)); |
@@ -461,7 +461,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
461 | return 3; | 461 | return 3; |
462 | } | 462 | } |
463 | 463 | ||
464 | stat = ide_read_status(drive); | 464 | stat = hwif->read_status(hwif); |
465 | 465 | ||
466 | if (OK_STAT(stat, READY_STAT, BUSY_STAT) || | 466 | if (OK_STAT(stat, READY_STAT, BUSY_STAT) || |
467 | drive->present || cmd == WIN_PIDENTIFY) { | 467 | drive->present || cmd == WIN_PIDENTIFY) { |
@@ -471,7 +471,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
471 | rc = try_to_identify(drive,cmd); | 471 | rc = try_to_identify(drive,cmd); |
472 | } | 472 | } |
473 | 473 | ||
474 | stat = ide_read_status(drive); | 474 | stat = hwif->read_status(hwif); |
475 | 475 | ||
476 | if (stat == (BUSY_STAT | READY_STAT)) | 476 | if (stat == (BUSY_STAT | READY_STAT)) |
477 | return 4; | 477 | return 4; |
@@ -488,7 +488,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
488 | } | 488 | } |
489 | 489 | ||
490 | /* ensure drive IRQ is clear */ | 490 | /* ensure drive IRQ is clear */ |
491 | stat = ide_read_status(drive); | 491 | stat = hwif->read_status(hwif); |
492 | 492 | ||
493 | if (rc == 1) | 493 | if (rc == 1) |
494 | printk(KERN_ERR "%s: no response (status = 0x%02x)\n", | 494 | printk(KERN_ERR "%s: no response (status = 0x%02x)\n", |
@@ -502,7 +502,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
502 | SELECT_DRIVE(&hwif->drives[0]); | 502 | SELECT_DRIVE(&hwif->drives[0]); |
503 | msleep(50); | 503 | msleep(50); |
504 | /* ensure drive irq is clear */ | 504 | /* ensure drive irq is clear */ |
505 | (void)ide_read_status(drive); | 505 | (void)hwif->read_status(hwif); |
506 | } | 506 | } |
507 | return rc; | 507 | return rc; |
508 | } | 508 | } |
@@ -527,7 +527,7 @@ static void enable_nest (ide_drive_t *drive) | |||
527 | 527 | ||
528 | msleep(50); | 528 | msleep(50); |
529 | 529 | ||
530 | stat = ide_read_status(drive); | 530 | stat = hwif->read_status(hwif); |
531 | 531 | ||
532 | if (!OK_STAT(stat, 0, BAD_STAT)) | 532 | if (!OK_STAT(stat, 0, BAD_STAT)) |
533 | printk(KERN_CONT "failed (status = 0x%02x)\n", stat); | 533 | printk(KERN_CONT "failed (status = 0x%02x)\n", stat); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 353dd11b9283..ef54728a74b0 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -927,11 +927,12 @@ static void idetape_create_mode_sense_cmd(struct ide_atapi_pc *pc, u8 page_code) | |||
927 | 927 | ||
928 | static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) | 928 | static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) |
929 | { | 929 | { |
930 | ide_hwif_t *hwif = drive->hwif; | ||
930 | idetape_tape_t *tape = drive->driver_data; | 931 | idetape_tape_t *tape = drive->driver_data; |
931 | struct ide_atapi_pc *pc = tape->pc; | 932 | struct ide_atapi_pc *pc = tape->pc; |
932 | u8 stat; | 933 | u8 stat; |
933 | 934 | ||
934 | stat = ide_read_status(drive); | 935 | stat = hwif->read_status(hwif); |
935 | 936 | ||
936 | if (stat & SEEK_STAT) { | 937 | if (stat & SEEK_STAT) { |
937 | if (stat & ERR_STAT) { | 938 | if (stat & ERR_STAT) { |
@@ -980,6 +981,7 @@ static void ide_tape_create_rw_cmd(idetape_tape_t *tape, | |||
980 | static ide_startstop_t idetape_do_request(ide_drive_t *drive, | 981 | static ide_startstop_t idetape_do_request(ide_drive_t *drive, |
981 | struct request *rq, sector_t block) | 982 | struct request *rq, sector_t block) |
982 | { | 983 | { |
984 | ide_hwif_t *hwif = drive->hwif; | ||
983 | idetape_tape_t *tape = drive->driver_data; | 985 | idetape_tape_t *tape = drive->driver_data; |
984 | struct ide_atapi_pc *pc = NULL; | 986 | struct ide_atapi_pc *pc = NULL; |
985 | struct request *postponed_rq = tape->postponed_rq; | 987 | struct request *postponed_rq = tape->postponed_rq; |
@@ -1017,7 +1019,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
1017 | * If the tape is still busy, postpone our request and service | 1019 | * If the tape is still busy, postpone our request and service |
1018 | * the other device meanwhile. | 1020 | * the other device meanwhile. |
1019 | */ | 1021 | */ |
1020 | stat = ide_read_status(drive); | 1022 | stat = hwif->read_status(hwif); |
1021 | 1023 | ||
1022 | if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2)) | 1024 | if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2)) |
1023 | set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags); | 1025 | set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags); |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index c56be289417e..fc2b3957afac 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -124,7 +124,8 @@ EXPORT_SYMBOL_GPL(do_rw_taskfile); | |||
124 | */ | 124 | */ |
125 | static ide_startstop_t set_multmode_intr(ide_drive_t *drive) | 125 | static ide_startstop_t set_multmode_intr(ide_drive_t *drive) |
126 | { | 126 | { |
127 | u8 stat = ide_read_status(drive); | 127 | ide_hwif_t *hwif = drive->hwif; |
128 | u8 stat = hwif->read_status(hwif); | ||
128 | 129 | ||
129 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) | 130 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) |
130 | drive->mult_count = drive->mult_req; | 131 | drive->mult_count = drive->mult_req; |
@@ -141,10 +142,11 @@ static ide_startstop_t set_multmode_intr(ide_drive_t *drive) | |||
141 | */ | 142 | */ |
142 | static ide_startstop_t set_geometry_intr(ide_drive_t *drive) | 143 | static ide_startstop_t set_geometry_intr(ide_drive_t *drive) |
143 | { | 144 | { |
145 | ide_hwif_t *hwif = drive->hwif; | ||
144 | int retries = 5; | 146 | int retries = 5; |
145 | u8 stat; | 147 | u8 stat; |
146 | 148 | ||
147 | while (((stat = ide_read_status(drive)) & BUSY_STAT) && retries--) | 149 | while (((stat = hwif->read_status(hwif)) & BUSY_STAT) && retries--) |
148 | udelay(10); | 150 | udelay(10); |
149 | 151 | ||
150 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) | 152 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) |
@@ -162,7 +164,8 @@ static ide_startstop_t set_geometry_intr(ide_drive_t *drive) | |||
162 | */ | 164 | */ |
163 | static ide_startstop_t recal_intr(ide_drive_t *drive) | 165 | static ide_startstop_t recal_intr(ide_drive_t *drive) |
164 | { | 166 | { |
165 | u8 stat = ide_read_status(drive); | 167 | ide_hwif_t *hwif = drive->hwif; |
168 | u8 stat = hwif->read_status(hwif); | ||
166 | 169 | ||
167 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) | 170 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) |
168 | return ide_error(drive, "recal_intr", stat); | 171 | return ide_error(drive, "recal_intr", stat); |
@@ -174,11 +177,12 @@ static ide_startstop_t recal_intr(ide_drive_t *drive) | |||
174 | */ | 177 | */ |
175 | static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | 178 | static ide_startstop_t task_no_data_intr(ide_drive_t *drive) |
176 | { | 179 | { |
177 | ide_task_t *args = HWGROUP(drive)->rq->special; | 180 | ide_hwif_t *hwif = drive->hwif; |
181 | ide_task_t *args = hwif->hwgroup->rq->special; | ||
178 | u8 stat; | 182 | u8 stat; |
179 | 183 | ||
180 | local_irq_enable_in_hardirq(); | 184 | local_irq_enable_in_hardirq(); |
181 | stat = ide_read_status(drive); | 185 | stat = hwif->read_status(hwif); |
182 | 186 | ||
183 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) | 187 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) |
184 | return ide_error(drive, "task_no_data_intr", stat); | 188 | return ide_error(drive, "task_no_data_intr", stat); |
@@ -192,6 +196,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | |||
192 | 196 | ||
193 | static u8 wait_drive_not_busy(ide_drive_t *drive) | 197 | static u8 wait_drive_not_busy(ide_drive_t *drive) |
194 | { | 198 | { |
199 | ide_hwif_t *hwif = drive->hwif; | ||
195 | int retries; | 200 | int retries; |
196 | u8 stat; | 201 | u8 stat; |
197 | 202 | ||
@@ -200,7 +205,7 @@ static u8 wait_drive_not_busy(ide_drive_t *drive) | |||
200 | * take up to 6 ms on some ATAPI devices, so we will wait max 10 ms. | 205 | * take up to 6 ms on some ATAPI devices, so we will wait max 10 ms. |
201 | */ | 206 | */ |
202 | for (retries = 0; retries < 1000; retries++) { | 207 | for (retries = 0; retries < 1000; retries++) { |
203 | stat = ide_read_status(drive); | 208 | stat = hwif->read_status(hwif); |
204 | 209 | ||
205 | if (stat & BUSY_STAT) | 210 | if (stat & BUSY_STAT) |
206 | udelay(10); | 211 | udelay(10); |
@@ -383,8 +388,8 @@ static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq | |||
383 | static ide_startstop_t task_in_intr(ide_drive_t *drive) | 388 | static ide_startstop_t task_in_intr(ide_drive_t *drive) |
384 | { | 389 | { |
385 | ide_hwif_t *hwif = drive->hwif; | 390 | ide_hwif_t *hwif = drive->hwif; |
386 | struct request *rq = HWGROUP(drive)->rq; | 391 | struct request *rq = hwif->hwgroup->rq; |
387 | u8 stat = ide_read_status(drive); | 392 | u8 stat = hwif->read_status(hwif); |
388 | 393 | ||
389 | /* Error? */ | 394 | /* Error? */ |
390 | if (stat & ERR_STAT) | 395 | if (stat & ERR_STAT) |
@@ -418,7 +423,7 @@ static ide_startstop_t task_out_intr (ide_drive_t *drive) | |||
418 | { | 423 | { |
419 | ide_hwif_t *hwif = drive->hwif; | 424 | ide_hwif_t *hwif = drive->hwif; |
420 | struct request *rq = HWGROUP(drive)->rq; | 425 | struct request *rq = HWGROUP(drive)->rq; |
421 | u8 stat = ide_read_status(drive); | 426 | u8 stat = hwif->read_status(hwif); |
422 | 427 | ||
423 | if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) | 428 | if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) |
424 | return task_error(drive, rq, __func__, stat); | 429 | return task_error(drive, rq, __func__, stat); |
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index 76ce112fd857..b20e5f01ac89 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -63,6 +63,11 @@ static u8 superio_ide_inb (unsigned long port) | |||
63 | return inb(port); | 63 | return inb(port); |
64 | } | 64 | } |
65 | 65 | ||
66 | static u8 superio_read_status(ide_hwif_t *hwif) | ||
67 | { | ||
68 | return superio_ide_inb(hwif->io_ports.status_addr); | ||
69 | } | ||
70 | |||
66 | static u8 superio_read_sff_dma_status(ide_hwif_t *hwif) | 71 | static u8 superio_read_sff_dma_status(ide_hwif_t *hwif) |
67 | { | 72 | { |
68 | return superio_ide_inb(hwif->dma_base + ATA_DMA_STATUS); | 73 | return superio_ide_inb(hwif->dma_base + ATA_DMA_STATUS); |
@@ -127,6 +132,7 @@ static void __devinit superio_ide_init_iops (struct hwif_s *hwif) | |||
127 | tmp = superio_ide_inb(superio_ide_dma_status[port]); | 132 | tmp = superio_ide_inb(superio_ide_dma_status[port]); |
128 | outb(tmp | 0x66, superio_ide_dma_status[port]); | 133 | outb(tmp | 0x66, superio_ide_dma_status[port]); |
129 | 134 | ||
135 | hwif->read_status = superio_read_status; | ||
130 | hwif->read_sff_dma_status = superio_read_sff_dma_status; | 136 | hwif->read_sff_dma_status = superio_read_sff_dma_status; |
131 | 137 | ||
132 | hwif->tf_read = superio_tf_read; | 138 | hwif->tf_read = superio_tf_read; |
@@ -283,7 +289,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
283 | outb(8, hwif->io_ports.ctl_addr); | 289 | outb(8, hwif->io_ports.ctl_addr); |
284 | do { | 290 | do { |
285 | udelay(50); | 291 | udelay(50); |
286 | stat = hwif->INB(hwif->io_ports.status_addr); | 292 | stat = hwif->read_status(hwif); |
287 | if (stat == 0xff) | 293 | if (stat == 0xff) |
288 | break; | 294 | break; |
289 | } while ((stat & BUSY_STAT) && --timeout); | 295 | } while ((stat & BUSY_STAT) && --timeout); |
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index d140dfd565a4..3d72a5e03f3d 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
@@ -134,6 +134,11 @@ static void scc_exec_command(ide_hwif_t *hwif, u8 cmd) | |||
134 | eieio(); | 134 | eieio(); |
135 | } | 135 | } |
136 | 136 | ||
137 | static u8 scc_read_status(ide_hwif_t *hwif) | ||
138 | { | ||
139 | return (u8)in_be32((void *)hwif->io_ports.status_addr); | ||
140 | } | ||
141 | |||
137 | static u8 scc_read_sff_dma_status(ide_hwif_t *hwif) | 142 | static u8 scc_read_sff_dma_status(ide_hwif_t *hwif) |
138 | { | 143 | { |
139 | return (u8)in_be32((void *)(hwif->dma_base + 4)); | 144 | return (u8)in_be32((void *)(hwif->dma_base + 4)); |
@@ -788,6 +793,7 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) | |||
788 | ide_set_hwifdata(hwif, ports); | 793 | ide_set_hwifdata(hwif, ports); |
789 | 794 | ||
790 | hwif->exec_command = scc_exec_command; | 795 | hwif->exec_command = scc_exec_command; |
796 | hwif->read_status = scc_read_status; | ||
791 | hwif->read_sff_dma_status = scc_read_sff_dma_status; | 797 | hwif->read_sff_dma_status = scc_read_sff_dma_status; |
792 | 798 | ||
793 | hwif->tf_load = scc_tf_load; | 799 | hwif->tf_load = scc_tf_load; |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 76afa1f9c599..3005a6334a58 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -127,7 +127,7 @@ sgiioc4_checkirq(ide_hwif_t * hwif) | |||
127 | return 0; | 127 | return 0; |
128 | } | 128 | } |
129 | 129 | ||
130 | static u8 sgiioc4_INB(unsigned long); | 130 | static u8 sgiioc4_read_status(ide_hwif_t *); |
131 | 131 | ||
132 | static int | 132 | static int |
133 | sgiioc4_clearirq(ide_drive_t * drive) | 133 | sgiioc4_clearirq(ide_drive_t * drive) |
@@ -141,18 +141,19 @@ sgiioc4_clearirq(ide_drive_t * drive) | |||
141 | intr_reg = readl((void __iomem *)other_ir); | 141 | intr_reg = readl((void __iomem *)other_ir); |
142 | if (intr_reg & 0x03) { /* Valid IOC4-IDE interrupt */ | 142 | if (intr_reg & 0x03) { /* Valid IOC4-IDE interrupt */ |
143 | /* | 143 | /* |
144 | * Using sgiioc4_INB to read the Status register has a side | 144 | * Using sgiioc4_read_status to read the Status register has a |
145 | * effect of clearing the interrupt. The first read should | 145 | * side effect of clearing the interrupt. The first read should |
146 | * clear it if it is set. The second read should return | 146 | * clear it if it is set. The second read should return |
147 | * a "clear" status if it got cleared. If not, then spin | 147 | * a "clear" status if it got cleared. If not, then spin |
148 | * for a bit trying to clear it. | 148 | * for a bit trying to clear it. |
149 | */ | 149 | */ |
150 | u8 stat = sgiioc4_INB(io_ports->status_addr); | 150 | u8 stat = sgiioc4_read_status(hwif); |
151 | int count = 0; | 151 | int count = 0; |
152 | stat = sgiioc4_INB(io_ports->status_addr); | 152 | |
153 | stat = sgiioc4_read_status(hwif); | ||
153 | while ((stat & 0x80) && (count++ < 100)) { | 154 | while ((stat & 0x80) && (count++ < 100)) { |
154 | udelay(1); | 155 | udelay(1); |
155 | stat = sgiioc4_INB(io_ports->status_addr); | 156 | stat = sgiioc4_read_status(hwif); |
156 | } | 157 | } |
157 | 158 | ||
158 | if (intr_reg & 0x02) { | 159 | if (intr_reg & 0x02) { |
@@ -304,9 +305,9 @@ sgiioc4_dma_lost_irq(ide_drive_t * drive) | |||
304 | ide_dma_lost_irq(drive); | 305 | ide_dma_lost_irq(drive); |
305 | } | 306 | } |
306 | 307 | ||
307 | static u8 | 308 | static u8 sgiioc4_read_status(ide_hwif_t *hwif) |
308 | sgiioc4_INB(unsigned long port) | ||
309 | { | 309 | { |
310 | unsigned long port = hwif->io_ports.status_addr; | ||
310 | u8 reg = (u8) readb((void __iomem *) port); | 311 | u8 reg = (u8) readb((void __iomem *) port); |
311 | 312 | ||
312 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ | 313 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ |
@@ -628,7 +629,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
628 | /* Initializing chipset IRQ Registers */ | 629 | /* Initializing chipset IRQ Registers */ |
629 | writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); | 630 | writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); |
630 | 631 | ||
631 | hwif->INB = &sgiioc4_INB; | 632 | hwif->read_status = sgiioc4_read_status; |
632 | 633 | ||
633 | idx[0] = hwif->index; | 634 | idx[0] = hwif->index; |
634 | 635 | ||