mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
asm-generic/io.h: check CONFIG_VIRT_TO_BUS
Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally have a silently failing incorrect direct mapped definition rather then no definition at all. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
19f949f525
commit
c93d031231
@ -332,6 +332,7 @@ extern void ioport_unmap(void __iomem *p);
|
|||||||
#define xlate_dev_kmem_ptr(p) p
|
#define xlate_dev_kmem_ptr(p) p
|
||||||
#define xlate_dev_mem_ptr(p) __va(p)
|
#define xlate_dev_mem_ptr(p) __va(p)
|
||||||
|
|
||||||
|
#ifdef CONFIG_VIRT_TO_BUS
|
||||||
#ifndef virt_to_bus
|
#ifndef virt_to_bus
|
||||||
static inline unsigned long virt_to_bus(volatile void *address)
|
static inline unsigned long virt_to_bus(volatile void *address)
|
||||||
{
|
{
|
||||||
@ -343,6 +344,7 @@ static inline void *bus_to_virt(unsigned long address)
|
|||||||
return (void *) address;
|
return (void *) address;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef memset_io
|
#ifndef memset_io
|
||||||
#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
|
#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
|
||||||
|
Loading…
Reference in New Issue
Block a user