ide: remove ide_do_drive_cmd()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 24 Mar 2009 22:22:44 +0000 (23:22 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 24 Mar 2009 22:22:44 +0000 (23:22 +0100)
* 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>
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-io.c
include/linux/ide.h

index 09ae30f46070abf933af9df5e379e5cea980ad71..3044c51c06a559cacb8776638ae3acb69d200337 100644 (file)
@@ -149,7 +149,10 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
        memcpy(rq->cmd, pc->c, 12);
        if (drive->media == ide_tape)
                rq->cmd[13] = REQ_IDETAPE_PC1;
-       ide_do_drive_cmd(drive, rq);
+
+       drive->hwif->rq = NULL;
+
+       elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
 }
 
 /*
index ddfbea41d296a738a1efb5ace07b22b9a7dff2ad..2177cd11664c216a50c927e884a0ba9fa522d8b4 100644 (file)
@@ -242,7 +242,9 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
                ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n",
                              failed_command->cmd[0]);
 
-       ide_do_drive_cmd(drive, rq);
+       drive->hwif->rq = NULL;
+
+       elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
 }
 
 static void cdrom_end_request(ide_drive_t *drive, int uptodate)
index 557b15700ea25c7b6a42e5d8967dd8ff8c91a0bc..56be3375bee448919399d70447e78e034667dc34 100644 (file)
@@ -1129,34 +1129,6 @@ out_early:
 }
 EXPORT_SYMBOL_GPL(ide_intr);
 
-/**
- *     ide_do_drive_cmd        -       issue IDE special command
- *     @drive: device to issue command
- *     @rq: request to issue
- *
- *     This function issues a special IDE device request
- *     onto the request queue.
- *
- *     the rq is queued at the head of the request queue, displacing
- *     the currently-being-processed request and this function
- *     returns immediately without waiting for the new rq to be
- *     completed.  This is VERY DANGEROUS, and is intended for
- *     careful use by the ATAPI tape/cdrom driver code.
- */
-
-void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
-{
-       struct request_queue *q = drive->queue;
-       unsigned long flags;
-
-       drive->hwif->rq = NULL;
-
-       spin_lock_irqsave(q->queue_lock, flags);
-       __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
-       spin_unlock_irqrestore(q->queue_lock, flags);
-}
-EXPORT_SYMBOL(ide_do_drive_cmd);
-
 void ide_pad_transfer(ide_drive_t *drive, int write, int len)
 {
        ide_hwif_t *hwif = drive->hwif;
index d0065a90452b886825a8be3573e7104cdc2f6bb0..8fadffe53cdef0677457aaaf4bad67ead09233a1 100644 (file)
@@ -1174,8 +1174,6 @@ extern ide_startstop_t ide_do_reset (ide_drive_t *);
 extern int ide_devset_execute(ide_drive_t *drive,
                              const struct ide_devset *setting, int arg);
 
-extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
-
 extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
 
 void ide_tf_dump(const char *, struct ide_taskfile *);