aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:46 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:46 -0400
commit122ab0887c36247bd4508c25e4fccf9264546fe2 (patch)
treeae8645bf5fb8ce6dbbafda5789f91fa002f335b3
parent3649c06e66ad3589374e8765ed69eda65658735c (diff)
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 <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-dma.c42
-rw-r--r--include/linux/ide.h2
2 files changed, 5 insertions, 39 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ada2a3ea9430..b77b7d138c49 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)
670 670
671EXPORT_SYMBOL(__ide_dma_good_drive); 671EXPORT_SYMBOL(__ide_dma_good_drive);
672 672
673int ide_use_dma(ide_drive_t *drive)
674{
675 struct hd_driveid *id = drive->id;
676 ide_hwif_t *hwif = drive->hwif;
677
678 if ((id->capability & 1) == 0 || drive->autodma == 0)
679 return 0;
680
681 /* consult the list of known "bad" drives */
682 if (__ide_dma_bad_drive(drive))
683 return 0;
684
685 /* capable of UltraDMA modes */
686 if (id->field_valid & 4) {
687 if (hwif->ultra_mask & id->dma_ultra)
688 return 1;
689 }
690
691 /* capable of regular DMA modes */
692 if (id->field_valid & 2) {
693 if (hwif->mwdma_mask & id->dma_mword)
694 return 1;
695 if (hwif->swdma_mask & id->dma_1word)
696 return 1;
697 }
698
699 /* consult the list of known "good" drives */
700 if (__ide_dma_good_drive(drive) && id->eide_dma_time < 150)
701 return 1;
702
703 return 0;
704}
705
706EXPORT_SYMBOL_GPL(ide_use_dma);
707
708static const u8 xfer_mode_bases[] = { 673static const u8 xfer_mode_bases[] = {
709 XFER_UDMA_0, 674 XFER_UDMA_0,
710 XFER_MW_DMA_0, 675 XFER_MW_DMA_0,
@@ -785,8 +750,11 @@ int ide_tune_dma(ide_drive_t *drive)
785{ 750{
786 u8 speed; 751 u8 speed;
787 752
788 /* TODO: use only ide_max_dma_mode() */ 753 if ((drive->id->capability & 1) == 0 || drive->autodma == 0)
789 if (!ide_use_dma(drive)) 754 return 0;
755
756 /* consult the list of known "bad" drives */
757 if (__ide_dma_bad_drive(drive))
790 return 0; 758 return 0;
791 759
792 speed = ide_max_dma_mode(drive); 760 speed = ide_max_dma_mode(drive);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index be789613007d..07aba87d369d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1281,7 +1281,6 @@ struct drive_list_entry {
1281int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1281int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1282int __ide_dma_bad_drive(ide_drive_t *); 1282int __ide_dma_bad_drive(ide_drive_t *);
1283int __ide_dma_good_drive(ide_drive_t *); 1283int __ide_dma_good_drive(ide_drive_t *);
1284int ide_use_dma(ide_drive_t *);
1285u8 ide_max_dma_mode(ide_drive_t *); 1284u8 ide_max_dma_mode(ide_drive_t *);
1286int ide_tune_dma(ide_drive_t *); 1285int ide_tune_dma(ide_drive_t *);
1287void ide_dma_off(ide_drive_t *); 1286void ide_dma_off(ide_drive_t *);
@@ -1309,7 +1308,6 @@ extern int __ide_dma_timeout(ide_drive_t *);
1309#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1308#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
1310 1309
1311#else 1310#else
1312static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
1313static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1311static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1314static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } 1312static inline int ide_tune_dma(ide_drive_t *drive) { return 0; }
1315static inline void ide_dma_off(ide_drive_t *drive) { ; } 1313static inline void ide_dma_off(ide_drive_t *drive) { ; }