Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nommu: add ioremap_page_range()

lib/ioremap.c is presently only built in if CONFIG_MMU is set. While this
is reasonable, platforms that support both CONFIG_MMU=y or n need to be
able to call in to this regardless.

As none of the current nommu platforms do anything special with ioremap(),
we assume that it's always successful.

This fixes the SH-4 build with CONFIG_MMU=n.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Paul Mundt and committed by
Linus Torvalds
218f0aae f0ee9aab

+8
+8
include/linux/io.h
··· 27 27 void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 28 28 void __iowrite64_copy(void __iomem *to, const void *from, size_t count); 29 29 30 + #ifdef CONFIG_MMU 30 31 int ioremap_page_range(unsigned long addr, unsigned long end, 31 32 unsigned long phys_addr, pgprot_t prot); 33 + #else 34 + static inline int ioremap_page_range(unsigned long addr, unsigned long end, 35 + unsigned long phys_addr, pgprot_t prot) 36 + { 37 + return 0; 38 + } 39 + #endif 32 40 33 41 /* 34 42 * Managed iomap interface