]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix build with CONFIG_BLK_DEV_IDEDMA=n (once again)
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>
Mon, 16 Feb 2004 23:39:36 +0000 (15:39 -0800)
committerJames Simmons <jsimmons@infradead.org>
Mon, 16 Feb 2004 23:39:36 +0000 (15:39 -0800)
My "__ide_dma_off()" cleanup uncovered some code that shouldn't be compiled
when CONFIG_BLK_DEV_IDEDMA=n.  Fix it and kill a warning in setup-pci.c.

Noticed by Martin Diehl <lists@mdiehl.de>.

drivers/ide/ide-iops.c
drivers/ide/ide.c
drivers/ide/setup-pci.c
include/linux/ide.h

index 0e5c935d82cc3e81d5aaa95bbce5ff6dad5c0b59..1755d50714f6c803fcafc88b29d434edc9527446 100644 (file)
@@ -1125,16 +1125,17 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
        return ide_stopped;
 }
 
-void check_dma_crc (ide_drive_t *drive)
+static void check_dma_crc(ide_drive_t *drive)
 {
+#ifdef CONFIG_BLK_DEV_IDEDMA
        if (drive->crc_count) {
                (void) HWIF(drive)->ide_dma_off_quietly(drive);
                ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
                if (drive->current_speed >= XFER_SW_DMA_0)
                        (void) HWIF(drive)->ide_dma_on(drive);
-       } else {
+       } else
                (void)__ide_dma_off(drive);
-       }
+#endif
 }
 
 void pre_reset (ide_drive_t *drive)
index c16afef3fc5be22c912ba479f2687f4234161f69..5a6212380db7ec3112cde47dc5ce30b2b75c3b2d 100644 (file)
@@ -1320,6 +1320,7 @@ static int set_io_32bit(ide_drive_t *drive, int arg)
 
 static int set_using_dma (ide_drive_t *drive, int arg)
 {
+#ifdef CONFIG_BLK_DEV_IDEDMA
        if (!drive->id || !(drive->id->capability & 1))
                return -EPERM;
        if (HWIF(drive)->ide_dma_check == NULL)
@@ -1332,6 +1333,9 @@ static int set_using_dma (ide_drive_t *drive, int arg)
                        return -EIO;
        }
        return 0;
+#else
+       return -EPERM;
+#endif
 }
 
 static int set_pio_mode (ide_drive_t *drive, int arg)
index a2ff75859e454063cdbb51cea3c60636c8d67ec3..ed5c9c4b5ce6114f2c1c29c38bfafb2e0f72cd51 100644 (file)
@@ -150,6 +150,8 @@ static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *name)
        return 0;
 }
 
+#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+
 #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED
 /*
  * Long lost data from 2.0.34 that is now in 2.0.39
@@ -279,6 +281,7 @@ second_chance_to_dma:
        }
        return dma_base;
 }
+#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 void ide_setup_pci_noise (struct pci_dev *dev, ide_pci_device_t *d)
 {
index 92c7daf0a896ccbd67cc7510e78af1c924f08472..f7c97c9b0b8f135249142dfd80ffa1fb04c99bfb 100644 (file)
@@ -1626,6 +1626,9 @@ extern ide_startstop_t __ide_dma_queued_read(ide_drive_t *drive);
 extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive);
 extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive);
 #endif
+
+#else
+static inline int __ide_dma_off(ide_drive_t *drive) { return 0; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
 #ifndef CONFIG_BLK_DEV_IDEDMA_PCI