summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-15 21:21:51 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 21:21:51 +0200
commit63f5abb0959337db0d5bece9cefba03cdcadec51 (patch)
tree908862cbb739d6571fab4b24f264d4d3671e6400 /drivers/ide/ide-io.c
parent7e12ca11d65f4cb29ed58ea3948f8c5d4f57b35e (diff)
downloadlinux-63f5abb0959337db0d5bece9cefba03cdcadec51.tar.gz
linux-63f5abb0959337db0d5bece9cefba03cdcadec51.tar.bz2
linux-63f5abb0959337db0d5bece9cefba03cdcadec51.zip
ide: remove action argument in ide_do_drive_cmd
ide_do_drive_cmd is called only with ide_preempt action argument. So we can remove the action argument in ide_do_drive_cmd and ide_action_t typedef. This patch also includes two minor cleanups: 1) ide_do_drive_cmd always succeeds so we don't need the return value; 2) the callers use blk_rq_init before ide_do_drive_cmd so there is no need to initialize rq->errors. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c28fcdf0ee9e..28057747c1f8 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1520,49 +1520,27 @@ irqreturn_t ide_intr (int irq, void *dev_id)
* ide_do_drive_cmd - issue IDE special command
* @drive: device to issue command
* @rq: request to issue
- * @action: action for processing
*
* This function issues a special IDE device request
* onto the request queue.
*
- * If action is ide_wait, then the rq is queued at the end of the
- * request queue, and the function sleeps until it has been processed.
- * This is for use when invoked from an ioctl handler.
- *
- * If action is ide_preempt, then 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.
- *
- * If action is ide_end, then the rq is queued at the end of the
- * request queue, and the function returns immediately without waiting
- * for the new rq to be completed. This is again intended for careful
- * use by the ATAPI tape/cdrom driver code.
+ * 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.
*/
-
-int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t action)
+
+void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
{
unsigned long flags;
ide_hwgroup_t *hwgroup = HWGROUP(drive);
- int where = ELEVATOR_INSERT_BACK;
-
- rq->errors = 0;
-
- if (action == ide_preempt)
- where = ELEVATOR_INSERT_FRONT;
spin_lock_irqsave(&ide_lock, flags);
- if (action == ide_preempt)
- hwgroup->rq = NULL;
- __elv_add_request(drive->queue, rq, where, 1);
+ hwgroup->rq = NULL;
+ __elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 1);
__generic_unplug_device(drive->queue);
- /* the queue is stopped so it won't be plugged+unplugged */
- if (blk_pm_resume_request(rq))
- do_ide_request(drive->queue);
spin_unlock_irqrestore(&ide_lock, flags);
-
- return 0;
}
EXPORT_SYMBOL(ide_do_drive_cmd);