[PATCH 10/10] ide-cd: use generic ide_issue_pc

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Borislav Petkov
Date: Sunday, September 14, 2008 - 4:35 am

... and remove cdrom_start_packet_command.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c |   48 ++++--------------------------------------------
 1 files changed, 4 insertions(+), 44 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 29bd205..495e5bb 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -513,50 +513,9 @@ end_request:
 }
 
 /*
- * Set up the device registers for transferring a packet command on DEV,
- * expecting to later transfer XFERLEN bytes.  HANDLER is the routine
- * which actually transfers the command to the drive.  If this is a
- * drq_interrupt device, this routine will arrange for HANDLER to be
- * called when the interrupt from the drive arrives.  Otherwise, HANDLER
- * will be called immediately after the drive is prepared for the transfer.
- */
-static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,
-						  int xferlen,
-						  ide_handler_t *handler)
-{
-	ide_hwif_t *hwif = drive->hwif;
-
-	ide_debug_log(IDE_DBG_PC, "Call %s, xferlen: %d\n", __func__, xferlen);
-
-	/* FIXME: for Virtual DMA we must check harder */
-	if (drive->dma)
-		drive->dma = !hwif->dma_ops->dma_setup(drive);
-
-	/* set up the controller registers */
-	ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL,
-			   xferlen, drive->dma);
-
-	if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {
-		/* waiting for CDB interrupt, not DMA yet. */
-		if (drive->dma)
-			drive->waiting_for_dma = 0;
-
-		/* packet command */
-		ide_execute_command(drive, ATA_CMD_PACKET, handler,
-				    ATAPI_WAIT_PC, cdrom_timer_expiry);
-		return ide_started;
-	} else {
-		ide_execute_pkt_cmd(drive);
-
-		return (*handler) (drive);
-	}
-}
-
-/*
  * Send a packet command to DRIVE described by CMD_BUF and CMD_LEN. The device
- * registers must have already been prepared by cdrom_start_packet_command.
- * HANDLER is the interrupt handler to call when the command completes or
- * there's data ready.
+ * registers must have already been prepared by ide_issue_pc. HANDLER is the
+ * interrupt handler to call when the command completes or there's data ready.
  */
 #define ATAPI_MIN_CDB_BYTES 12
 static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive,
@@ -1290,7 +1249,8 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
 		return ide_stopped;
 	}
 
-	return cdrom_start_packet_command(drive, xferlen, fn);
+	return ide_issue_pc(drive, ATAPI_WAIT_PC, cdrom_timer_expiry,
+			    xferlen, fn);
 }
 
 /*
-- 
1.5.5.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/10] ide-cd: use generic ide_issue_pc, Borislav Petkov, (Sun Sep 14, 4:35 am)
[PATCH 01/10] ide: add ide_drive_t.dma flag, Borislav Petkov, (Sun Sep 14, 4:35 am)
[PATCH 02/10] ide-cd: move cdrom_info.dma to ide_drive_t.dma, Borislav Petkov, (Sun Sep 14, 4:35 am)
[PATCH 06/10] ide-atapi: add a DEV_IS_IDECD macro, Borislav Petkov, (Sun Sep 14, 4:35 am)
[PATCH 07/10] ide-atapi: prepare ide-cd expiry handler, Borislav Petkov, (Sun Sep 14, 4:35 am)
[PATCH 10/10] ide-cd: use generic ide_issue_pc, Borislav Petkov, (Sun Sep 14, 4:35 am)
Re: [PATCH 01/10] ide: add ide_drive_t.dma flag, Bartlomiej Zolnierki ..., (Mon Sep 15, 10:51 am)
Re: [PATCH 02/10] ide-cd: move cdrom_info.dma to ide_drive ..., Bartlomiej Zolnierki ..., (Mon Sep 15, 10:54 am)
Re: [PATCH 04/10] ide-atapi: assign taskfile flags per dev ..., Bartlomiej Zolnierki ..., (Mon Sep 15, 10:54 am)
Re: [PATCH 05/10] ide-atapi: accomodate transfer length to ..., Bartlomiej Zolnierki ..., (Mon Sep 15, 11:15 am)
Re: [PATCH 03/10] ide-atapi: teach ide atapi about drive-&gt; ..., Bartlomiej Zolnierki ..., (Mon Sep 15, 11:15 am)
Re: [PATCH 06/10] ide-atapi: add a DEV_IS_IDECD macro, Bartlomiej Zolnierki ..., (Mon Sep 15, 11:19 am)
Re: [PATCH 07/10] ide-atapi: prepare ide-cd expiry handler, Bartlomiej Zolnierki ..., (Mon Sep 15, 11:25 am)
Re: [PATCH 00/10] ide-cd: use generic ide_issue_pc, Bartlomiej Zolnierki ..., (Mon Sep 15, 11:30 am)
Re: [PATCH 03/10] ide-atapi: teach ide atapi about drive-&gt; ..., Bartlomiej Zolnierki ..., (Wed Sep 17, 9:32 am)