sh: Kill off virt_to_bus()/bus_to_virt().
authorPaul Mundt <lethal@linux-sh.org>
Wed, 25 Jul 2007 02:18:00 +0000 (11:18 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 26 Jul 2007 06:37:40 +0000 (15:37 +0900)
Wire up ARCH_NO_VIRT_TO_BUS, and kill off the remaining users. The
dma-mapping code really wanted virt_to_phys()/phys_to_virt() anyways,
there are no inherently special bus addresses.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/Kconfig
include/asm-sh/dma-mapping.h
include/asm-sh/floppy.h
include/asm-sh/io.h

index 0a631d0f75f1550782a716441a2d69fc45318321..ec2beabb193ce4b24e921f62366165a0ca8c93c4 100644 (file)
@@ -90,6 +90,9 @@ config ARCH_HAS_ILOG2_U64
        bool
        default n
 
+config ARCH_NO_VIRT_TO_BUS
+       def_bool y
+
 source "init/Kconfig"
 
 menu "System type"
index d3bc7818bbbea2e6631f781739266fb740d0bb7e..6f492ac3fa136b8f9fdd55e91e0c21fc9633235b 100644 (file)
@@ -69,11 +69,11 @@ static inline dma_addr_t dma_map_single(struct device *dev,
 {
 #if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
        if (dev->bus == &pci_bus_type)
-               return virt_to_bus(ptr);
+               return virt_to_phys(ptr);
 #endif
        dma_cache_sync(dev, ptr, size, dir);
 
-       return virt_to_bus(ptr);
+       return virt_to_phys(ptr);
 }
 
 #define dma_unmap_single(dev, addr, size, dir) do { } while (0)
@@ -116,7 +116,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
        if (dev->bus == &pci_bus_type)
                return;
 #endif
-       dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir);
+       dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir);
 }
 
 static inline void dma_sync_single_range(struct device *dev,
@@ -128,7 +128,7 @@ static inline void dma_sync_single_range(struct device *dev,
        if (dev->bus == &pci_bus_type)
                return;
 #endif
-       dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir);
+       dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
 }
 
 static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
index dc1ad464fa32f2b2fe30f7ba48f0223744e0d34a..3b59b3af777bb16214072e4cb732230c295dbbbd 100644 (file)
@@ -181,7 +181,7 @@ static void _fd_chose_dma_mode(char *addr, unsigned long size)
 {
        if(can_use_virtual_dma == 2) {
                if((unsigned int) addr >= (unsigned int) high_memory ||
-                  virt_to_bus(addr) >= 0x10000000)
+                  virt_to_phys(addr) >= 0x10000000)
                        use_virtual_dma = 1;
                else
                        use_virtual_dma = 0;
@@ -219,7 +219,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
        doing_pdma = 0;
        clear_dma_ff(FLOPPY_DMA);
        set_dma_mode(FLOPPY_DMA,mode);
-       set_dma_addr(FLOPPY_DMA,virt_to_bus(addr));
+       set_dma_addr(FLOPPY_DMA,virt_to_phys(addr));
        set_dma_count(FLOPPY_DMA,size);
        enable_dma(FLOPPY_DMA);
        return 0;
index aa80930ce8e4ccbc089132c8645309eedd9f7b1e..e6a1877dcb205a79c4b7baa62371c27399a51795 100644 (file)
@@ -241,10 +241,6 @@ static inline void *phys_to_virt(unsigned long address)
 #define virt_to_phys(address)  ((unsigned long)(address))
 #endif
 
-#define virt_to_bus virt_to_phys
-#define bus_to_virt phys_to_virt
-#define page_to_bus page_to_phys
-
 /*
  * readX/writeX() are used to access memory mapped devices. On some
  * architectures the memory mapped IO stuff needs to be accessed