Re: [PATCH] powerpc: uninline of_iomap function
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-04-24 22:36:02
On Tue, 2007-04-24 at 17:32 +0200, Christian Krafft wrote:
From: Christian Krafft <redacted> There is no big reason to have that function inlined. Signed-off-by: Christian Krafft <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
quoted hunk ↗ jump to hunk
Index: linux-2.6.21-rc4/arch/powerpc/kernel/prom_parse.c ===================================================================--- linux-2.6.21-rc4.orig/arch/powerpc/kernel/prom_parse.c +++ linux-2.6.21-rc4/arch/powerpc/kernel/prom_parse.c@@ -1042,3 +1042,15 @@ const void *of_get_mac_address(struct de } EXPORT_SYMBOL(of_get_mac_address); +void __iomem *of_iomap(struct device_node *np, int index) +{ + struct resource res; + + if (of_address_to_resource(np, index, &res)) + return NULL; + + return ioremap(res.start, 1 + res.end - res.start); +} +EXPORT_SYMBOL(of_iomap); + +Index: linux-2.6.21-rc4/include/asm-powerpc/prom.h ===================================================================--- linux-2.6.21-rc4.orig/include/asm-powerpc/prom.h +++ linux-2.6.21-rc4/include/asm-powerpc/prom.h@@ -19,7 +19,6 @@ #include <linux/proc_fs.h> #include <linux/platform_device.h> #include <asm/atomic.h> -#include <asm/io.h> /* Definitions used by the flattened device tree */ #define OF_DT_HEADER 0xd00dfeed /* marker */@@ -352,16 +351,14 @@ static inline int of_irq_to_resource(str return irq; } -static inline void __iomem *of_iomap(struct device_node *np, int index) -{ - struct resource res; - - if (of_address_to_resource(np, index, &res)) - return NULL; - - return ioremap(res.start, 1 + res.end - res.start); -} - +/** + * of_iomap - Maps the memory mapped IO for a given device_node + * @device: the device whose io range will be mapped + * @index: index of the io range + * + * Returns a pointer to the mapped memory + */ +extern void __iomem *of_iomap(struct device_node *device, int index); #endif /* __KERNEL__ */ #endif /* _POWERPC_PROM_H */