diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-05 20:57:51 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-05 20:57:51 -0500 |
commit | 64a57fe4393bae920d03c253173f59d8a7ec8e25 (patch) | |
tree | bfbac6fa370401d519a6fd9433a330dd55efe68d /drivers/ide | |
parent | c47137a99c597330b69057158b26061a360c0e09 (diff) |
ide: add ide_read_error() inline helper
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-lib.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 5 |
7 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 892e42e80a32..5e42c19a03e3 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -304,7 +304,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
304 | return 0; | 304 | return 0; |
305 | 305 | ||
306 | /* Get the IDE error register. */ | 306 | /* Get the IDE error register. */ |
307 | err = HWIF(drive)->INB(IDE_ERROR_REG); | 307 | err = ide_read_error(drive); |
308 | sense_key = err >> 4; | 308 | sense_key = err >> 4; |
309 | 309 | ||
310 | if (rq == NULL) { | 310 | if (rq == NULL) { |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 3ac79ed2bc63..faf22d716f80 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -465,7 +465,7 @@ static void idefloppy_retry_pc(ide_drive_t *drive) | |||
465 | idefloppy_pc_t *pc; | 465 | idefloppy_pc_t *pc; |
466 | struct request *rq; | 466 | struct request *rq; |
467 | 467 | ||
468 | (void)drive->hwif->INB(IDE_ERROR_REG); | 468 | (void)ide_read_error(drive); |
469 | pc = idefloppy_next_pc_storage(drive); | 469 | pc = idefloppy_next_pc_storage(drive); |
470 | rq = idefloppy_next_rq_storage(drive); | 470 | rq = idefloppy_next_rq_storage(drive); |
471 | idefloppy_create_request_sense_cmd(pc); | 471 | idefloppy_create_request_sense_cmd(pc); |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 29cb043a2d3a..3addbe478d26 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -821,8 +821,8 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
821 | #ifdef DEBUG | 821 | #ifdef DEBUG |
822 | printk("%s: DRIVE_CMD (null)\n", drive->name); | 822 | printk("%s: DRIVE_CMD (null)\n", drive->name); |
823 | #endif | 823 | #endif |
824 | ide_end_drive_cmd(drive, ide_read_status(drive), | 824 | ide_end_drive_cmd(drive, ide_read_status(drive), ide_read_error(drive)); |
825 | hwif->INB(IDE_ERROR_REG)); | 825 | |
826 | return ide_stopped; | 826 | return ide_stopped; |
827 | } | 827 | } |
828 | 828 | ||
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 716244c45211..c32e759df208 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -918,7 +918,9 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) | |||
918 | drive->failures++; | 918 | drive->failures++; |
919 | } else { | 919 | } else { |
920 | printk("%s: reset: ", hwif->name); | 920 | printk("%s: reset: ", hwif->name); |
921 | if ((tmp = hwif->INB(IDE_ERROR_REG)) == 1) { | 921 | tmp = ide_read_error(drive); |
922 | |||
923 | if (tmp == 1) { | ||
922 | printk("success\n"); | 924 | printk("success\n"); |
923 | drive->failures = 0; | 925 | drive->failures = 0; |
924 | } else { | 926 | } else { |
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index b42940d8bf70..1ff676cc6473 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -578,7 +578,7 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
578 | } | 578 | } |
579 | printk("}\n"); | 579 | printk("}\n"); |
580 | if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { | 580 | if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { |
581 | err = drive->hwif->INB(IDE_ERROR_REG); | 581 | err = ide_read_error(drive); |
582 | printk("%s: %s: error=0x%02x ", drive->name, msg, err); | 582 | printk("%s: %s: error=0x%02x ", drive->name, msg, err); |
583 | if (drive->media == ide_disk) | 583 | if (drive->media == ide_disk) |
584 | ide_dump_ata_error(drive, err); | 584 | ide_dump_ata_error(drive, err); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 66801c084dd8..401731302c5c 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -1125,7 +1125,7 @@ static ide_startstop_t idetape_retry_pc (ide_drive_t *drive) | |||
1125 | idetape_pc_t *pc; | 1125 | idetape_pc_t *pc; |
1126 | struct request *rq; | 1126 | struct request *rq; |
1127 | 1127 | ||
1128 | (void)drive->hwif->INB(IDE_ERROR_REG); | 1128 | (void)ide_read_error(drive); |
1129 | pc = idetape_next_pc_storage(drive); | 1129 | pc = idetape_next_pc_storage(drive); |
1130 | rq = idetape_next_rq_storage(drive); | 1130 | rq = idetape_next_rq_storage(drive); |
1131 | idetape_create_request_sense_cmd(pc); | 1131 | idetape_create_request_sense_cmd(pc); |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 2545dde6ee02..0518a2e948cf 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -241,7 +241,6 @@ static ide_startstop_t recal_intr(ide_drive_t *drive) | |||
241 | static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | 241 | static ide_startstop_t task_no_data_intr(ide_drive_t *drive) |
242 | { | 242 | { |
243 | ide_task_t *args = HWGROUP(drive)->rq->special; | 243 | ide_task_t *args = HWGROUP(drive)->rq->special; |
244 | ide_hwif_t *hwif = HWIF(drive); | ||
245 | u8 stat; | 244 | u8 stat; |
246 | 245 | ||
247 | local_irq_enable_in_hardirq(); | 246 | local_irq_enable_in_hardirq(); |
@@ -252,7 +251,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | |||
252 | /* calls ide_end_drive_cmd */ | 251 | /* calls ide_end_drive_cmd */ |
253 | 252 | ||
254 | if (args) | 253 | if (args) |
255 | ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG)); | 254 | ide_end_drive_cmd(drive, stat, ide_read_error(drive)); |
256 | 255 | ||
257 | return ide_stopped; | 256 | return ide_stopped; |
258 | } | 257 | } |
@@ -408,7 +407,7 @@ static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq, | |||
408 | void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) | 407 | void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) |
409 | { | 408 | { |
410 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { | 409 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
411 | u8 err = drive->hwif->INB(IDE_ERROR_REG); | 410 | u8 err = ide_read_error(drive); |
412 | 411 | ||
413 | ide_end_drive_cmd(drive, stat, err); | 412 | ide_end_drive_cmd(drive, stat, err); |
414 | return; | 413 | return; |