[PATCH 16/16] ide: move check_dma_crc() to ide-dma.c

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-ide@...>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@...>, <linux-kernel@...>
Date: Monday, January 21, 2008 - 7:32 pm

* Move check_dma_crc() to ide-dma.c and add inline version for
  CONFIG_BLK_DEV_IDEDMA=n case.

* Rename check_dma_crc() to ide_check_dma_crc().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-dma.c  |   20 ++++++++++++++++++++
 drivers/ide/ide-iops.c |   24 +-----------------------
 include/linux/ide.h    |    2 ++
 3 files changed, 23 insertions(+), 23 deletions(-)

Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -821,6 +821,26 @@ int ide_set_dma(ide_drive_t *drive)
 	return 0;
 }
 
+void ide_check_dma_crc(ide_drive_t *drive)
+{
+	u8 mode;
+
+	ide_dma_off_quietly(drive);
+	drive->crc_count = 0;
+	mode = drive->current_speed;
+	/*
+	 * Don't try non Ultra-DMA modes without iCRC's.  Force the
+	 * device to PIO and make the user enable SWDMA/MWDMA modes.
+	 */
+	if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7)
+		mode--;
+	else
+		mode = XFER_PIO_4;
+	ide_set_xfer_rate(drive, mode);
+	if (drive->current_speed >= XFER_SW_DMA_0)
+		ide_dma_on(drive);
+}
+
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 void ide_dma_lost_irq (ide_drive_t *drive)
 {
Index: b/drivers/ide/ide-iops.c
===================================================================
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -938,28 +938,6 @@ static ide_startstop_t reset_pollfunc (i
 	return ide_stopped;
 }
 
-static void check_dma_crc(ide_drive_t *drive)
-{
-#ifdef CONFIG_BLK_DEV_IDEDMA
-	u8 mode;
-
-	ide_dma_off_quietly(drive);
-	drive->crc_count = 0;
-	mode = drive->current_speed;
-	/*
-	 * Don't try non Ultra-DMA modes without iCRC's.  Force the
-	 * device to PIO and make the user enable SWDMA/MWDMA modes.
-	 */
-	if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7)
-		mode--;
-	else
-		mode = XFER_PIO_4;
-	ide_set_xfer_rate(drive, mode);
-	if (drive->current_speed >= XFER_SW_DMA_0)
-		ide_dma_on(drive);
-#endif
-}
-
 static void ide_disk_pre_reset(ide_drive_t *drive)
 {
 	int legacy = (drive->id->cfs_enable_2 & 0x0400) ? 0 : 1;
@@ -983,7 +961,7 @@ static void pre_reset(ide_drive_t *drive
 
 	if (drive->using_dma) {
 		if (drive->crc_count)
-			check_dma_crc(drive);
+			ide_check_dma_crc(drive);
 		else
 			ide_dma_off(drive);
 	}
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1158,6 +1158,7 @@ void ide_dma_off_quietly(ide_drive_t *);
 void ide_dma_off(ide_drive_t *);
 void ide_dma_on(ide_drive_t *);
 int ide_set_dma(ide_drive_t *);
+void ide_check_dma_crc(ide_drive_t *);
 ide_startstop_t ide_dma_intr(ide_drive_t *);
 
 int ide_build_sglist(ide_drive_t *, struct request *);
@@ -1185,6 +1186,7 @@ static inline void ide_dma_off(ide_drive
 static inline void ide_dma_on(ide_drive_t *drive) { ; }
 static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
 static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
+static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
 #ifndef CONFIG_BLK_DEV_IDEDMA_PCI
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/16] ide: various fixes/cleanups, Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:30 pm)
[PATCH 16/16] ide: move check_dma_crc() to ide-dma.c, Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:32 pm)
[PATCH 15/16] ide: remove ide_auto_reduce_xfer(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:32 pm)
Re: [PATCH 15/16] ide: remove ide_auto_reduce_xfer(), Sergei Shtylyov, (Tue Jan 22, 12:39 pm)
[PATCH 14/16] ide: move drive-&gt;crc_count check out from c..., Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:32 pm)
[PATCH 13/16] ide: remove ide_ata66_check(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:32 pm)
Re: [PATCH 13/16] ide: remove ide_ata66_check(), Sergei Shtylyov, (Tue Jan 22, 12:31 pm)
[PATCH 12/16] ide: remove set_transfer(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
Re: [PATCH 12/16] ide: remove set_transfer(), Sergei Shtylyov, (Tue Jan 22, 10:24 am)
[PATCH 11/16] ide: unexport SELECT_DRIVE(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
Re: [PATCH 11/16] ide: unexport SELECT_DRIVE(), Sergei Shtylyov, (Tue Jan 22, 12:28 pm)
[PATCH 10/16] ide: use __ide_set_handler() in ide_execute_co..., Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 09/16] ide: remove SATA_*_REG macros, Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 08/16] ide: remove -&gt;nice0 and -&gt;nice2 fields f..., Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 07/16] ide: convert -&gt;straight8 field in ide_hwif_..., Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 06/16] ide: remove unused -&gt;auto_poll field from i..., Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 05/16] ide-probe: remove needless Status register reads, Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
[PATCH 04/16] ide-cris: use ide_execute_command(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:31 pm)
Re: [PATCH 04/16] ide-cris: use ide_execute_command(), Sergei Shtylyov, (Tue Jan 22, 10:34 am)
[PATCH 03/16] trm290: use ide_execute_command(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:30 pm)
Re: [PATCH 03/16] trm290: use ide_execute_command(), Sergei Shtylyov, (Tue Jan 22, 10:32 am)
[PATCH 02/16] ide-scsi: use ide_execute_command(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:30 pm)
Re: [PATCH 02/16] ide-scsi: use ide_execute_command(), Sergei Shtylyov, (Tue Jan 22, 10:32 am)
[PATCH 01/16] ide-tape: use ide_execute_command(), Bartlomiej Zolnierkiewicz..., (Mon Jan 21, 7:30 pm)
Re: [PATCH 01/16] ide-tape: use ide_execute_command(), Sergei Shtylyov, (Tue Jan 22, 10:32 am)