linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/9] ide: remove ide_do_drive_cmd()
Date: Thu, 15 Jan 2009 21:01:08 +0100	[thread overview]
Message-ID: <20090115200108.17294.11783.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090115200032.17294.84745.sendpatchset@localhost.localdomain>

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] 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.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-atapi.c |    5 ++++-
 drivers/ide/ide-cd.c    |    4 +++-
 drivers/ide/ide-io.c    |   28 ----------------------------
 include/linux/ide.h     |    2 --
 4 files changed, 7 insertions(+), 32 deletions(-)

Index: b/drivers/ide/ide-atapi.c
===================================================================
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -143,7 +143,10 @@ static void ide_queue_pc_head(ide_drive_
 	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: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -234,7 +234,9 @@ static void cdrom_queue_request_sense(id
 		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: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1125,34 +1125,6 @@ out_early:
 	return irq_ret;
 }
 
-/**
- *	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: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1172,8 +1172,6 @@ extern ide_startstop_t ide_do_reset (ide
 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 *);

  parent reply	other threads:[~2009-01-15 20:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 20:00 [PATCH 0/9] ide: core code housekeeping Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 1/9] ide: remove stale comments from drive_is_ready() Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 2/9] ide: unexport ide_devset_execute() Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 3/9] ide: move drive_is_ready() to ide-io.c Bartlomiej Zolnierkiewicz
2009-01-17 20:22   ` Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 4/9] ide: move ide_dma_timeout_retry() to ide-dma.c Bartlomiej Zolnierkiewicz
2009-01-17 20:20   ` Sergei Shtylyov
2009-01-15 20:01 ` Bartlomiej Zolnierkiewicz [this message]
2009-01-17 20:13   ` [PATCH 5/9] ide: remove ide_do_drive_cmd() Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 6/9] ide: factor out processing of special commands from ide_special_rq() Bartlomiej Zolnierkiewicz
2009-01-15 20:01 ` [PATCH 7/9] ide: move ide_do_park_unpark() to ide-park.c Bartlomiej Zolnierkiewicz
2009-01-17 20:14   ` Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 8/9] ide: move device settings code to ide-devsets.c Bartlomiej Zolnierkiewicz
2009-01-15 20:01 ` [PATCH 9/9] ide: move xfer mode tuning code to ide-xfer-mode.c Bartlomiej Zolnierkiewicz

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=20090115200108.17294.11783.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).