[PATCH 32/40] ide-{floppy,tape}: move checking of ->failed_pc to ->callback

From: Bartlomiej Zolnierkiewicz
Date: Sun May 18 2008 - 14:49:58 EST


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@xxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>---
---
drivers/ide/ide-floppy.c | 5 +++--
drivers/ide/ide-tape.c | 7 +++----
2 files changed, 6 insertions(+), 6 deletions(-)

Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -320,6 +320,9 @@ static void ide_floppy_callback(ide_driv

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 */
@@ -435,8 +438,6 @@ static ide_startstop_t idefloppy_pc_intr
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;
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -627,6 +627,9 @@ static void ide_tape_callback(ide_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);
@@ -838,8 +841,6 @@ static ide_startstop_t idetape_pc_intr(i
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;
@@ -1050,8 +1051,6 @@ static ide_startstop_t idetape_media_acc
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/