linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <petkovbb@googlemail.com>
To: bzolnier@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Borislav Petkov <petkovbb@gmail.com>
Subject: [PATCH 8/9] ide-atapi: replace pc->error with drive->pc_error
Date: Tue, 16 Dec 2008 08:36:08 +0100	[thread overview]
Message-ID: <1229412969-3552-9-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1229412969-3552-1-git-send-email-petkovbb@gmail.com>

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-atapi.c  |    3 ++-
 drivers/ide/ide-floppy.c |    6 +++---
 drivers/ide/ide-tape.c   |   20 ++++++++++----------
 include/linux/ide.h      |    1 +
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index e514b47..160d085 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -124,6 +124,7 @@ void ide_init_pc(ide_drive_t *drive, struct ide_atapi_pc *pc)
 	drive->pc_buf_size = IDE_PC_BUFFER_SIZE;
 	drive->pc_flags = 0;
 	drive->pc_req_xfer = 0;
+	drive->pc_error = 0;
 }
 EXPORT_SYMBOL_GPL(ide_init_pc);
 
@@ -377,7 +378,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 			/* queued, but not started */
 			return ide_stopped;
 		}
-		pc->error = 0;
+		drive->pc_error = 0;
 
 		if ((drive->pc_flags & PC_FLAG_WAIT_FOR_DSC) &&
 		    (stat & ATA_DSC) == 0)
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 0977229..3d6345e 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -119,7 +119,7 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
 {
 	struct ide_disk_obj *floppy = drive->driver_data;
 	struct ide_atapi_pc *pc = drive->pc;
-	int uptodate = pc->error ? 0 : 1;
+	int uptodate = drive->pc_error ? 0 : 1;
 
 	ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
 
@@ -132,7 +132,7 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
 	else if (pc->c[0] == GPCMD_REQUEST_SENSE) {
 		u8 *buf = pc->buf;
 
-		if (!pc->error) {
+		if (!drive->pc_error) {
 			floppy->sense_key = buf[2] & 0x0F;
 			floppy->asc = buf[12];
 			floppy->ascq = buf[13];
@@ -186,7 +186,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
 		if (!(drive->pc_flags & PC_FLAG_SUPPRESS_ERROR))
 			ide_floppy_report_error(floppy, pc);
 		/* Giving up */
-		pc->error = IDEFLOPPY_ERROR_GENERAL;
+		drive->pc_error = IDEFLOPPY_ERROR_GENERAL;
 
 		floppy->failed_pc = NULL;
 		drive->pc_callback(drive, 0);
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 2bfa612..015b417 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -429,25 +429,25 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 *sense)
 	    && pc->c[4] == 0 && pc->c[3] == 0 && pc->c[2] == 0) {
 		if (tape->sense_key == 5) {
 			/* don't report an error, everything's ok */
-			pc->error = 0;
+			drive->pc_error = 0;
 			/* don't retry read/write */
 			drive->pc_flags |= PC_FLAG_ABORT;
 		}
 	}
 	if (pc->c[0] == READ_6 && (sense[2] & 0x80)) {
-		pc->error = IDETAPE_ERROR_FILEMARK;
+		drive->pc_error = IDETAPE_ERROR_FILEMARK;
 		drive->pc_flags |= PC_FLAG_ABORT;
 	}
 	if (pc->c[0] == WRITE_6) {
 		if ((sense[2] & 0x40) || (tape->sense_key == 0xd
 		     && tape->asc == 0x0 && tape->ascq == 0x2)) {
-			pc->error = IDETAPE_ERROR_EOD;
+			drive->pc_error = IDETAPE_ERROR_EOD;
 			drive->pc_flags |= PC_FLAG_ABORT;
 		}
 	}
 	if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) {
 		if (tape->sense_key == 8) {
-			pc->error = IDETAPE_ERROR_EOD;
+			drive->pc_error = IDETAPE_ERROR_EOD;
 			drive->pc_flags |= PC_FLAG_ABORT;
 		}
 		if (!(drive->pc_flags & PC_FLAG_ABORT) && rq->data_len)
@@ -515,7 +515,7 @@ static void ide_tape_callback(ide_drive_t *drive, int dsc)
 {
 	idetape_tape_t *tape = drive->driver_data;
 	struct ide_atapi_pc *pc = drive->pc;
-	int uptodate = pc->error ? 0 : 1;
+	int uptodate = drive->pc_error ? 0 : 1;
 
 	debug_log(DBG_PROCS, "Enter %s\n", __func__);
 
@@ -547,8 +547,8 @@ static void ide_tape_callback(ide_drive_t *drive, int dsc)
 		tape->first_frame += blocks;
 		rq->current_nr_sectors -= blocks;
 
-		if (pc->error)
-			uptodate = pc->error;
+		if (drive->pc_error)
+			uptodate = drive->pc_error;
 	} else if (pc->c[0] == READ_POSITION && uptodate) {
 		u8 *readpos = pc->buf;
 
@@ -685,7 +685,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
 						tape->ascq);
 			}
 			/* Giving up */
-			pc->error = IDETAPE_ERROR_GENERAL;
+			drive->pc_error = IDETAPE_ERROR_GENERAL;
 		}
 		tape->failed_pc = NULL;
 		drive->pc_callback(drive, 0);
@@ -746,9 +746,9 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
 			ide_retry_pc(drive, tape->disk);
 			return ide_stopped;
 		}
-		pc->error = 0;
+		drive->pc_error = 0;
 	} else {
-		pc->error = IDETAPE_ERROR_GENERAL;
+		drive->pc_error = IDETAPE_ERROR_GENERAL;
 		tape->failed_pc = NULL;
 	}
 	drive->pc_callback(drive, 0);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 0940db9..291600c 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -658,6 +658,7 @@ struct ide_drive_s {
 	unsigned long pc_flags;
 	int pc_req_xfer;
 	int pc_buf_size;
+	int pc_error;
 
 	/* callback for packet commands */
 	void (*pc_callback)(struct ide_drive_s *, int);
-- 
1.6.0.4


  parent reply	other threads:[~2008-12-16  7:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  7:36 [PATCH 0/9] ide-atapi: remove ide_atapi_pc from the irq handler Borislav Petkov
2008-12-16  7:36 ` [PATCH 1/9] ide-atapi: remove PC_FLAG_WRITING atapi flag Borislav Petkov
2008-12-16  7:36 ` [PATCH 2/9] ide-atapi: replace pc->flags with drive->pc_flags Borislav Petkov
2008-12-16  7:36 ` [PATCH 3/9] ide-atapi: replace pc->buf with rq->data in the irq handler Borislav Petkov
2008-12-16  7:36 ` [PATCH 4/9] ide-atapi: replace pc->req_xfer with drive->pc_req_xfer Borislav Petkov
2008-12-16  7:36 ` [PATCH 5/9] ide-atapi: replace pc->buf_size with drive->pc_buf_size Borislav Petkov
2008-12-16  7:36 ` [PATCH 6/9] ide-atapi: remove pc arg to drive->pc_io_buffers Borislav Petkov
2008-12-16  7:36 ` [PATCH 7/9] ide-atapi: use rq pointer directly instead of pc->rq deref Borislav Petkov
2008-12-16  7:36 ` Borislav Petkov [this message]
2008-12-16  7:36 ` [PATCH 9/9] ide-atapi: remove pc arg to drive->pc_update_buffers Borislav Petkov
2008-12-16 20:35 ` [PATCH 0/9] ide-atapi: remove ide_atapi_pc from the irq handler Bartlomiej Zolnierkiewicz
2008-12-17  7:25   ` Borislav Petkov
2008-12-17 16:45     ` Bartlomiej Zolnierkiewicz
2008-12-17 19:29       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229412969-3552-9-git-send-email-petkovbb@gmail.com \
    --to=petkovbb@googlemail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).