aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:11 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:11 -0500
commit145b75e9aedbe36c55e45da8564dcd0814bdd89e (patch)
tree2bf27bb6657b28d12404de416276bca1c2ba52a4
parent2624565caacedd740fce7803fe2c162842aa5df4 (diff)
ide: initialize rq->cmd_type in ide_init_drive_cmd() callers
* Initialize rq->cmd_type in ide_wait_cmd(), ide_cmd_ioctl() and set_pio_mode() (other callers were aleady over-riding rq->cmd_type). * Remove no longer needed rq->cmd_type setup from ide_init_drive_cmd(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-io.c1
-rw-r--r--drivers/ide/ide-taskfile.c4
-rw-r--r--drivers/ide/ide.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 513a5685db2f..8c9890414eb2 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1672,7 +1672,6 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1672void ide_init_drive_cmd (struct request *rq) 1672void ide_init_drive_cmd (struct request *rq)
1673{ 1673{
1674 memset(rq, 0, sizeof(*rq)); 1674 memset(rq, 0, sizeof(*rq));
1675 rq->cmd_type = REQ_TYPE_ATA_CMD;
1676 rq->ref_count = 1; 1675 rq->ref_count = 1;
1677} 1676}
1678 1677
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index b559bece6e73..b8c7e8134d88 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -759,6 +759,7 @@ int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors,
759 buf = buffer; 759 buf = buffer;
760 memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors); 760 memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors);
761 ide_init_drive_cmd(&rq); 761 ide_init_drive_cmd(&rq);
762 rq.cmd_type = REQ_TYPE_ATA_CMD;
762 rq.buffer = buf; 763 rq.buffer = buf;
763 *buf++ = cmd; 764 *buf++ = cmd;
764 *buf++ = nsect; 765 *buf++ = nsect;
@@ -778,7 +779,10 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
778 779
779 if (NULL == (void *) arg) { 780 if (NULL == (void *) arg) {
780 struct request rq; 781 struct request rq;
782
781 ide_init_drive_cmd(&rq); 783 ide_init_drive_cmd(&rq);
784 rq.cmd_type = REQ_TYPE_ATA_CMD;
785
782 return ide_do_drive_cmd(drive, &rq, ide_wait); 786 return ide_do_drive_cmd(drive, &rq, ide_wait);
783 } 787 }
784 788
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 52115ef1f01a..446b12850155 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -878,7 +878,10 @@ int set_pio_mode(ide_drive_t *drive, int arg)
878 878
879 if (drive->special.b.set_tune) 879 if (drive->special.b.set_tune)
880 return -EBUSY; 880 return -EBUSY;
881
881 ide_init_drive_cmd(&rq); 882 ide_init_drive_cmd(&rq);
883 rq.cmd_type = REQ_TYPE_ATA_CMD;
884
882 drive->tune_req = (u8) arg; 885 drive->tune_req = (u8) arg;
883 drive->special.b.set_tune = 1; 886 drive->special.b.set_tune = 1;
884 (void) ide_do_drive_cmd(drive, &rq, ide_wait); 887 (void) ide_do_drive_cmd(drive, &rq, ide_wait);