[PATCH 1/9] davinci: make __arch_ioremap() with 0 size return NULL

Jamie Iles jamie at jamieiles.com
Mon Aug 1 08:31:02 EDT 2011


Without __arch_ioremap(), __get_vm_area_node() with a zero size will
return a NULL pointer.  Make the arch specific ioremap() do the same
thing.

Cc: Sekhar Nori <nsekhar at ti.com> (supporter:TI DAVINCI MACHIN...)
Cc: Kevin Hilman <khilman at ti.com> (supporter:TI DAVINCI MACHIN...)
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
 arch/arm/mach-davinci/io.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
index 8ea60a8..4eb169b 100644
--- a/arch/arm/mach-davinci/io.c
+++ b/arch/arm/mach-davinci/io.c
@@ -25,6 +25,9 @@ void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
 	int desc_num = davinci_soc_info.io_desc_num;
 	int i;
 
+	if (!size)
+		return NULL;
+
 	for (i = 0; i < desc_num; i++, desc++) {
 		unsigned long iophys = __pfn_to_phys(desc->pfn);
 		unsigned long iosize = desc->length;
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list