From: Paul Mundt Date: Mon, 28 Sep 2009 06:04:04 +0000 (+0900) Subject: sh: Handle ioport_map() cases for >= P1SEG addresses. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=48ff3e04ffd5e1b578462eb1958f15ca122c7fbf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git sh: Handle ioport_map() cases for >= P1SEG addresses. This fixes up the case where certain drivers already do their own remapping and subsequently attempt to use the PIO calls for I/O. In this case there is no additional remapping that needs to be done, and the address can be casted in to the cookie directly. Signed-off-by: Paul Mundt --- diff --git a/arch/sh/kernel/io_generic.c b/arch/sh/kernel/io_generic.c index 4ff507239286..b8fa6524760a 100644 --- a/arch/sh/kernel/io_generic.c +++ b/arch/sh/kernel/io_generic.c @@ -147,6 +147,9 @@ void generic_outsl(unsigned long port, const void *src, unsigned long count) void __iomem *generic_ioport_map(unsigned long addr, unsigned int size) { + if (PXSEG(addr) >= P1SEG) + return (void __iomem *)addr; + return (void __iomem *)(addr + generic_io_base); }