aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:44 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:44 -0400
commit1866082339597930c5b77aad8de34ab4fbb5724f (patch)
tree364832322ceae98f41233fd095558b1700cf3634
parent65ca5377322c7543163066f373ae9e6b0ad8de8a (diff)
ide: remove ide_do_drive_cmd()
* Use elv_add_request() instead of __elv_add_request() in ide_do_drive_cmd(). * ide_do_drive_cmd() is used only in ide-{atapi,cd}.c so inline it there. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-atapi.c5
-rw-r--r--drivers/ide/ide-cd.c4
-rw-r--r--drivers/ide/ide-io.c28
-rw-r--r--include/linux/ide.h2
4 files changed, 7 insertions, 32 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 09ae30f46070..3044c51c06a5 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -149,7 +149,10 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
149 memcpy(rq->cmd, pc->c, 12); 149 memcpy(rq->cmd, pc->c, 12);
150 if (drive->media == ide_tape) 150 if (drive->media == ide_tape)
151 rq->cmd[13] = REQ_IDETAPE_PC1; 151 rq->cmd[13] = REQ_IDETAPE_PC1;
152 ide_do_drive_cmd(drive, rq); 152
153 drive->hwif->rq = NULL;
154
155 elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
153} 156}
154 157
155/* 158/*
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index ddfbea41d296..2177cd11664c 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -242,7 +242,9 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
242 ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n", 242 ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n",
243 failed_command->cmd[0]); 243 failed_command->cmd[0]);
244 244
245 ide_do_drive_cmd(drive, rq); 245 drive->hwif->rq = NULL;
246
247 elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
246} 248}
247 249
248static void cdrom_end_request(ide_drive_t *drive, int uptodate) 250static void cdrom_end_request(ide_drive_t *drive, int uptodate)
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 557b15700ea2..56be3375bee4 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1129,34 +1129,6 @@ out_early:
1129} 1129}
1130EXPORT_SYMBOL_GPL(ide_intr); 1130EXPORT_SYMBOL_GPL(ide_intr);
1131 1131
1132/**
1133 * ide_do_drive_cmd - issue IDE special command
1134 * @drive: device to issue command
1135 * @rq: request to issue
1136 *
1137 * This function issues a special IDE device request
1138 * onto the request queue.
1139 *
1140 * the rq is queued at the head of the request queue, displacing
1141 * the currently-being-processed request and this function
1142 * returns immediately without waiting for the new rq to be
1143 * completed. This is VERY DANGEROUS, and is intended for
1144 * careful use by the ATAPI tape/cdrom driver code.
1145 */
1146
1147void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
1148{
1149 struct request_queue *q = drive->queue;
1150 unsigned long flags;
1151
1152 drive->hwif->rq = NULL;
1153
1154 spin_lock_irqsave(q->queue_lock, flags);
1155 __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
1156 spin_unlock_irqrestore(q->queue_lock, flags);
1157}
1158EXPORT_SYMBOL(ide_do_drive_cmd);
1159
1160void ide_pad_transfer(ide_drive_t *drive, int write, int len) 1132void ide_pad_transfer(ide_drive_t *drive, int write, int len)
1161{ 1133{
1162 ide_hwif_t *hwif = drive->hwif; 1134 ide_hwif_t *hwif = drive->hwif;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d0065a90452b..8fadffe53cde 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1174,8 +1174,6 @@ extern ide_startstop_t ide_do_reset (ide_drive_t *);
1174extern int ide_devset_execute(ide_drive_t *drive, 1174extern int ide_devset_execute(ide_drive_t *drive,
1175 const struct ide_devset *setting, int arg); 1175 const struct ide_devset *setting, int arg);
1176 1176
1177extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
1178
1179extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 1177extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
1180 1178
1181void ide_tf_dump(const char *, struct ide_taskfile *); 1179void ide_tf_dump(const char *, struct ide_taskfile *);