Skip to content

Commit

Permalink
ide-{floppy,tape}: move checking of ->failed_pc to ->callback
Browse files Browse the repository at this point in the history
Move checking/resetting of ->failed_pc from ide*_pc_intr() to ->callback
as a preparation for adding generic ide_pc_intr() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>---
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 15, 2008
1 parent 6bf1641 commit dd2e9a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ static void ide_floppy_callback(ide_drive_t *drive)

debug_log("Reached %s\n", __func__);

if (floppy->failed_pc == pc)
floppy->failed_pc = NULL;

if (pc->c[0] == GPCMD_READ_10 || pc->c[0] == GPCMD_WRITE_10 ||
(pc->rq && blk_pc_request(pc->rq)))
uptodate = 1; /* FIXME */
Expand Down Expand Up @@ -435,8 +438,6 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
return ide_stopped;
}
pc->error = 0;
if (floppy->failed_pc == pc)
floppy->failed_pc = NULL;
/* Command finished - Call the callback function */
pc->callback(drive);
return ide_stopped;
Expand Down
7 changes: 3 additions & 4 deletions drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ static void ide_tape_callback(ide_drive_t *drive)

debug_log(DBG_PROCS, "Enter %s\n", __func__);

if (tape->failed_pc == pc)
tape->failed_pc = NULL;

if (pc->c[0] == REQUEST_SENSE) {
if (uptodate)
idetape_analyze_error(drive, pc->buf);
Expand Down Expand Up @@ -838,8 +841,6 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
idetape_postpone_request(drive);
return ide_stopped;
}
if (tape->failed_pc == pc)
tape->failed_pc = NULL;
/* Command finished - Call the callback function */
pc->callback(drive);
return ide_stopped;
Expand Down Expand Up @@ -1050,8 +1051,6 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
return ide_stopped;
}
pc->error = 0;
if (tape->failed_pc == pc)
tape->failed_pc = NULL;
} else {
pc->error = IDETAPE_ERROR_GENERAL;
tape->failed_pc = NULL;
Expand Down

0 comments on commit dd2e9a0

Please sign in to comment.