From: Liviu Dudau Date: Mon, 29 Sep 2014 14:29:20 +0000 (+0100) Subject: asm-generic/io.h: Fix ioport_map() for !CONFIG_GENERIC_IOMAP X-Git-Tag: v3.18-rc1~110^2~5^2~9 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=112eeaa7f87bbd2925e919486bb504f8954fa675;p=linux.git asm-generic/io.h: Fix ioport_map() for !CONFIG_GENERIC_IOMAP The !CONFIG_GENERIC_IOMAP version of ioport_map() is wrong. It returns a mapped, i.e., virtual, address that can start from zero and completely ignores the PCI_IOBASE and IO_SPACE_LIMIT that most architectures that use !CONFIG_GENERIC_MAP define. Tested-by: Tanmay Inamdar Signed-off-by: Liviu Dudau Signed-off-by: Bjorn Helgaas Reviewed-by: Catalin Marinas Acked-by: Arnd Bergmann --- diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 975e1cc75edb..b8fdc57a7335 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -331,7 +331,7 @@ static inline void iounmap(void __iomem *addr) #ifndef CONFIG_GENERIC_IOMAP static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) { - return (void __iomem *) port; + return PCI_IOBASE + (port & IO_SPACE_LIMIT); } static inline void ioport_unmap(void __iomem *p)