diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index dc4bc06f9871..986ec465cb77 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -810,7 +810,7 @@ void ide_dma_timeout (ide_drive_t *drive) | |||
810 | 810 | ||
811 | EXPORT_SYMBOL(ide_dma_timeout); | 811 | EXPORT_SYMBOL(ide_dma_timeout); |
812 | 812 | ||
813 | static void ide_release_dma_engine(ide_hwif_t *hwif) | 813 | void ide_release_dma_engine(ide_hwif_t *hwif) |
814 | { | 814 | { |
815 | if (hwif->dmatable_cpu) { | 815 | if (hwif->dmatable_cpu) { |
816 | struct pci_dev *pdev = to_pci_dev(hwif->dev); | 816 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
@@ -821,27 +821,6 @@ static void ide_release_dma_engine(ide_hwif_t *hwif) | |||
821 | } | 821 | } |
822 | } | 822 | } |
823 | 823 | ||
824 | static int ide_release_iomio_dma(ide_hwif_t *hwif) | ||
825 | { | ||
826 | release_region(hwif->dma_base, 8); | ||
827 | if (hwif->extra_ports) | ||
828 | release_region(hwif->extra_base, hwif->extra_ports); | ||
829 | return 1; | ||
830 | } | ||
831 | |||
832 | /* | ||
833 | * Needed for allowing full modular support of ide-driver | ||
834 | */ | ||
835 | int ide_release_dma(ide_hwif_t *hwif) | ||
836 | { | ||
837 | ide_release_dma_engine(hwif); | ||
838 | |||
839 | if (hwif->mmio) | ||
840 | return 1; | ||
841 | else | ||
842 | return ide_release_iomio_dma(hwif); | ||
843 | } | ||
844 | |||
845 | static int ide_allocate_dma_engine(ide_hwif_t *hwif) | 824 | static int ide_allocate_dma_engine(ide_hwif_t *hwif) |
846 | { | 825 | { |
847 | struct pci_dev *pdev = to_pci_dev(hwif->dev); | 826 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
@@ -871,25 +850,9 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base) | |||
871 | printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", | 850 | printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", |
872 | hwif->name, base, base + 7); | 851 | hwif->name, base, base + 7); |
873 | 852 | ||
874 | if (!request_region(base, 8, hwif->name)) { | 853 | if (hwif->cds->extra) |
875 | printk(" -- Error, ports in use.\n"); | ||
876 | return 1; | ||
877 | } | ||
878 | |||
879 | if (hwif->cds->extra) { | ||
880 | hwif->extra_base = base + (hwif->channel ? 8 : 16); | 854 | hwif->extra_base = base + (hwif->channel ? 8 : 16); |
881 | 855 | ||
882 | if (!hwif->mate || !hwif->mate->extra_ports) { | ||
883 | if (!request_region(hwif->extra_base, | ||
884 | hwif->cds->extra, hwif->cds->name)) { | ||
885 | printk(" -- Error, extra ports in use.\n"); | ||
886 | release_region(base, 8); | ||
887 | return 1; | ||
888 | } | ||
889 | hwif->extra_ports = hwif->cds->extra; | ||
890 | } | ||
891 | } | ||
892 | |||
893 | return 0; | 856 | return 0; |
894 | } | 857 | } |
895 | 858 | ||
@@ -909,7 +872,7 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) | |||
909 | return; | 872 | return; |
910 | 873 | ||
911 | if (ide_allocate_dma_engine(hwif)) { | 874 | if (ide_allocate_dma_engine(hwif)) { |
912 | ide_release_dma(hwif); | 875 | ide_release_dma_engine(hwif); |
913 | return; | 876 | return; |
914 | } | 877 | } |
915 | 878 | ||