linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: make ioport_map() handle already mapped ranges
@ 2007-05-12 14:32 Olof Johansson
  2007-05-12 22:18 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2007-05-12 14:32 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

Make ioport_map() handle already mapped port range without trying
to add _IO_BASE to them.


Signed-off-by: Olof Johansson <olof@lixom.net>

Index: 2.6.21/arch/powerpc/kernel/iomap.c
===================================================================
--- 2.6.21.orig/arch/powerpc/kernel/iomap.c
+++ 2.6.21/arch/powerpc/kernel/iomap.c
@@ -106,7 +106,13 @@ EXPORT_SYMBOL(iowrite32_rep);
 
 void __iomem *ioport_map(unsigned long port, unsigned int len)
 {
-	return (void __iomem *) (port + _IO_BASE);
+	/* Do nothing if we're being asked to map an already
+	 * ioremapped() address
+	 */
+	if (port >= IMALLOC_BASE && (port+len) < IMALLOC_END)
+		return (void __iomem *) port;
+	else
+		return (void __iomem *) (port + _IO_BASE);
 }
 
 void ioport_unmap(void __iomem *addr)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-13  1:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-12 14:32 [PATCH] powerpc: make ioport_map() handle already mapped ranges Olof Johansson
2007-05-12 22:18 ` Arnd Bergmann
2007-05-12 22:36   ` Olof Johansson
2007-05-12 23:55     ` Arnd Bergmann
2007-05-13  1:46       ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).