diff mbox

[2/2] sh: Add sh_io_port_base check in __ioport_map function

Message ID 1301200307-5321-2-git-send-email-iwamatsu@nigauri.org (mailing list archive)
State Rejected
Headers show

Commit Message

Nobuhiro Iwamatsu March 27, 2011, 4:31 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/sh/kernel/ioport.c b/arch/sh/kernel/ioport.c
index e3ad610..30937e9 100644
--- a/arch/sh/kernel/ioport.c
+++ b/arch/sh/kernel/ioport.c
@@ -19,6 +19,10 @@  void __iomem *__ioport_map(unsigned long addr, unsigned int size)
 	if (sh_mv.mv_ioport_map)
 		return sh_mv.mv_ioport_map(addr, size);
 
+	/* Don't use sh_io_port_base */
+	if (sh_io_port_base == -1)
+		return (void __iomem *)addr;
+
 	return (void __iomem *)(addr + sh_io_port_base);
 }
 EXPORT_SYMBOL(__ioport_map);