aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-18 18:47:26 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-18 18:47:26 -0400
commit9889376ab91f89a5af7329ae34521dfc4b613ba9 (patch)
treebe68b5d253dffcb3d70bad665cb565dec11d462a /arch
parent930952af15f8425115528447102ed97610e98949 (diff)
sparc: Implement of_iomap().
Grab the pre-computed resource and map using of_ioremap(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/of_device_common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c
index 0ed0321d84e9..cb15bbf8a201 100644
--- a/arch/sparc/kernel/of_device_common.c
+++ b/arch/sparc/kernel/of_device_common.c
@@ -35,6 +35,20 @@ int of_address_to_resource(struct device_node *node, int index,
35} 35}
36EXPORT_SYMBOL_GPL(of_address_to_resource); 36EXPORT_SYMBOL_GPL(of_address_to_resource);
37 37
38void __iomem *of_iomap(struct device_node *node, int index)
39{
40 struct platform_device *op = of_find_device_by_node(node);
41 struct resource *r;
42
43 if (!op || index >= op->num_resources)
44 return NULL;
45
46 r = &op->archdata.resource[index];
47
48 return of_ioremap(r, 0, resource_size(r), (char *) r->name);
49}
50EXPORT_SYMBOL(of_iomap);
51
38/* Take the archdata values for IOMMU, STC, and HOSTDATA found in 52/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
39 * BUS and propagate to all child platform_device objects. 53 * BUS and propagate to all child platform_device objects.
40 */ 54 */