diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:41 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:41 +0100 |
commit | 0a1248c5a754cc8dc5b10a902d2f86b40144165c (patch) | |
tree | 81dbeefbccba76fa4b15478162a305aa2d5923b1 /drivers/ide/ide-taskfile.c | |
parent | 151055ed84df7bebc77d88471302a7cd02c6e0a4 (diff) |
ide: unify exit paths in task_pio_intr()
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index a01c2c0450d..79900a7a62e 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -326,35 +326,28 @@ static ide_startstop_t task_pio_intr(ide_drive_t *drive) if (write == 0) { /* Error? */ if (stat & ATA_ERR) - return task_error(drive, cmd, __func__, stat); + goto out_err; /* Didn't want any data? Odd. */ if ((stat & ATA_DRQ) == 0) { /* Command all done? */ - if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) { - ide_finish_cmd(drive, cmd, stat); - return ide_stopped; - } + if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) + goto out_end; /* Assume it was a spurious irq */ - ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, - NULL); - - return ide_started; + goto out_wait; } } else { if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) - return task_error(drive, cmd, __func__, stat); + goto out_err; /* Deal with unexpected ATA data phase. */ if (((stat & ATA_DRQ) == 0) ^ (cmd->nleft == 0)) - return task_error(drive, cmd, __func__, stat); + goto out_err; } - if (write && cmd->nleft == 0) { - ide_finish_cmd(drive, cmd, stat); - return ide_stopped; - } + if (write && cmd->nleft == 0) + goto out_end; /* Still data left to transfer. */ ide_pio_datablock(drive, cmd, write); @@ -363,15 +356,19 @@ static ide_startstop_t task_pio_intr(ide_drive_t *drive) if (write == 0 && cmd->nleft == 0) { stat = wait_drive_not_busy(drive); if (!OK_STAT(stat, 0, BAD_STAT)) - return task_error(drive, cmd, __func__, stat); - ide_finish_cmd(drive, cmd, stat); - return ide_stopped; - } + goto out_err; + goto out_end; + } +out_wait: /* Still data left to transfer. */ ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, NULL); - return ide_started; +out_end: + ide_finish_cmd(drive, cmd, stat); + return ide_stopped; +out_err: + return task_error(drive, cmd, __func__, stat); } static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, |