aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-11-12 17:16:12 -0500
committerArnd Bergmann <arnd@arndb.de>2013-02-14 09:04:33 -0500
commita5d533ee07690b9f904ca7b3732eed3d1134d4bc (patch)
tree90a300fd004eb15b573a87604c3e1414df3b06be
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
ARM: disable virt_to_bus/virt_to_bus almost everywhere
We are getting a number of warnings about the use of the deprecated bus_to_virt function in drivers using the ARM ISA DMA API: drivers/parport/parport_pc.c: In function 'parport_pc_fifo_write_block_dma': drivers/parport/parport_pc.c:622:3: warning: 'bus_to_virt' is deprecated (declared at arch/arm/include/asm/memory.h:253) [-Wdeprecated-declarations] This is only because that function gets used by the inline set_dma_addr() helper. We know that any driver for the ISA DMA API is correctly using the DMA addresses, so we can change this to use the __bus_to_virt() function instead, which does not warn. After this, there are no remaining drivers that are used on any defconfigs on ARM using virt_to_bus or bus_to_virt, with the exception of the OSS sound driver. That driver is only used on RiscPC, NetWinder and Shark, so we can set ARCH_NO_VIRT_TO_BUS on all other platforms and hide the deprecated functions, which is far more effective than marking them as deprecated, in order to avoid any new users of that code. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <linux@arm.linux.org.uk>
-rw-r--r--arch/arm/Kconfig4
-rw-r--r--arch/arm/configs/shark_defconfig1
-rw-r--r--arch/arm/include/asm/dma.h2
-rw-r--r--arch/arm/include/asm/memory.h2
4 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 67874b82a4ed..91d4aeaa772b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1450,6 +1450,10 @@ config ISA_DMA
1450 bool 1450 bool
1451 select ISA_DMA_API 1451 select ISA_DMA_API
1452 1452
1453config ARCH_NO_VIRT_TO_BUS
1454 def_bool y
1455 depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
1456
1453# Select ISA DMA interface 1457# Select ISA DMA interface
1454config ISA_DMA_API 1458config ISA_DMA_API
1455 bool 1459 bool
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index caa07db90cf5..e319b2c56f11 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -73,7 +73,6 @@ CONFIG_PARTITION_ADVANCED=y
73CONFIG_NLS_CODEPAGE_437=m 73CONFIG_NLS_CODEPAGE_437=m
74CONFIG_NLS_CODEPAGE_850=m 74CONFIG_NLS_CODEPAGE_850=m
75CONFIG_NLS_ISO8859_1=m 75CONFIG_NLS_ISO8859_1=m
76# CONFIG_ENABLE_WARN_DEPRECATED is not set
77# CONFIG_ENABLE_MUST_CHECK is not set 76# CONFIG_ENABLE_MUST_CHECK is not set
78CONFIG_DEBUG_KERNEL=y 77CONFIG_DEBUG_KERNEL=y
79# CONFIG_SCHED_DEBUG is not set 78# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index 5694a0d6576b..58b8c6a0ab1f 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -105,7 +105,7 @@ extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
105 */ 105 */
106extern void __set_dma_addr(unsigned int chan, void *addr); 106extern void __set_dma_addr(unsigned int chan, void *addr);
107#define set_dma_addr(chan, addr) \ 107#define set_dma_addr(chan, addr) \
108 __set_dma_addr(chan, bus_to_virt(addr)) 108 __set_dma_addr(chan, (void *)__bus_to_virt(addr))
109 109
110/* Set the DMA byte count for this channel 110/* Set the DMA byte count for this channel
111 * 111 *
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 73cf03aa981e..b11105c8599a 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -245,6 +245,7 @@ static inline void *phys_to_virt(phys_addr_t x)
245#define __bus_to_pfn(x) __phys_to_pfn(x) 245#define __bus_to_pfn(x) __phys_to_pfn(x)
246#endif 246#endif
247 247
248#ifdef CONFIG_VIRT_TO_BUS
248static inline __deprecated unsigned long virt_to_bus(void *x) 249static inline __deprecated unsigned long virt_to_bus(void *x)
249{ 250{
250 return __virt_to_bus((unsigned long)x); 251 return __virt_to_bus((unsigned long)x);
@@ -254,6 +255,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
254{ 255{
255 return (void *)__bus_to_virt(x); 256 return (void *)__bus_to_virt(x);
256} 257}
258#endif
257 259
258/* 260/*
259 * Conversion between a struct page and a physical address. 261 * Conversion between a struct page and a physical address.