]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ide: move check_dma_crc() to ide-dma.c
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:47 +0000 (19:56 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:47 +0000 (19:56 +0100)
* 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
drivers/ide/ide-iops.c
include/linux/ide.h

index 7beaf1e9be1264432f597f4376320e588cb0edc0..3cf59f2c392853298ed46155269e60ab2ca68692 100644 (file)
@@ -819,6 +819,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 b7da44c9e91c8bb3ff2eb022cc7f3000dbccddc7..a95178f5e1bb4f1e3b5517ba97c84f2ddefd5596 100644 (file)
@@ -938,28 +938,6 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
        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 748af8dc089508db324813a6e1c160b6a1146fbe..367c17084a28091fda5a6dc8bc503a029ad021f3 100644 (file)
@@ -1155,6 +1155,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 *);
@@ -1182,6 +1183,7 @@ static inline void ide_dma_off(ide_drive_t *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