Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=122ab0887c36247bd4508c25e4fccf9264546fe2
Commit:     122ab0887c36247bd4508c25e4fccf9264546fe2
Parent:     3649c06e66ad3589374e8765ed69eda65658735c
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

    ide: remove ide_use_dma()
    
    ide_use_dma() duplicates a lot of ide_max_dma_mode() functionality
    and as all users of ide_use_dma() were converted to use ide_tune_dma()
    now it is possible to add missing checks to ide_tune_dma() and remove
    ide_use_dma() completely, so do it.
    
    There should be no functionality changes caused by this patch.
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c |   42 +++++-------------------------------------
 include/linux/ide.h   |    2 --
 2 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ada2a3e..b77b7d1 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -670,41 +670,6 @@ int __ide_dma_good_drive (ide_drive_t *drive)
 
 EXPORT_SYMBOL(__ide_dma_good_drive);
 
-int ide_use_dma(ide_drive_t *drive)
-{
-       struct hd_driveid *id = drive->id;
-       ide_hwif_t *hwif = drive->hwif;
-
-       if ((id->capability & 1) == 0 || drive->autodma == 0)
-               return 0;
-
-       /* consult the list of known "bad" drives */
-       if (__ide_dma_bad_drive(drive))
-               return 0;
-
-       /* capable of UltraDMA modes */
-       if (id->field_valid & 4) {
-               if (hwif->ultra_mask & id->dma_ultra)
-                       return 1;
-       }
-
-       /* capable of regular DMA modes */
-       if (id->field_valid & 2) {
-               if (hwif->mwdma_mask & id->dma_mword)
-                       return 1;
-               if (hwif->swdma_mask & id->dma_1word)
-                       return 1;
-       }
-
-       /* consult the list of known "good" drives */
-       if (__ide_dma_good_drive(drive) && id->eide_dma_time < 150)
-               return 1;
-
-       return 0;
-}
-
-EXPORT_SYMBOL_GPL(ide_use_dma);
-
 static const u8 xfer_mode_bases[] = {
        XFER_UDMA_0,
        XFER_MW_DMA_0,
@@ -785,8 +750,11 @@ int ide_tune_dma(ide_drive_t *drive)
 {
        u8 speed;
 
-       /* TODO: use only ide_max_dma_mode() */
-       if (!ide_use_dma(drive))
+       if ((drive->id->capability & 1) == 0 || drive->autodma == 0)
+               return 0;
+
+       /* consult the list of known "bad" drives */
+       if (__ide_dma_bad_drive(drive))
                return 0;
 
        speed = ide_max_dma_mode(drive);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index be78961..07aba87 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1281,7 +1281,6 @@ struct drive_list_entry {
 int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
 int __ide_dma_bad_drive(ide_drive_t *);
 int __ide_dma_good_drive(ide_drive_t *);
-int ide_use_dma(ide_drive_t *);
 u8 ide_max_dma_mode(ide_drive_t *);
 int ide_tune_dma(ide_drive_t *);
 void ide_dma_off(ide_drive_t *);
@@ -1309,7 +1308,6 @@ extern int __ide_dma_timeout(ide_drive_t *);
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 #else
-static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
 static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
 static inline int ide_tune_dma(ide_drive_t *drive) { return 0; }
 static inline void ide_dma_off(ide_drive_t *drive) { ; }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to