From: David S. Miller Date: Fri, 18 Mar 2011 22:47:26 +0000 (-0700) Subject: sparc: Implement of_iomap(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9889376ab91f89a5af7329ae34521dfc4b613ba9;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git sparc: Implement of_iomap(). Grab the pre-computed resource and map using of_ioremap(). Signed-off-by: David S. Miller --- 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, } EXPORT_SYMBOL_GPL(of_address_to_resource); +void __iomem *of_iomap(struct device_node *node, int index) +{ + struct platform_device *op = of_find_device_by_node(node); + struct resource *r; + + if (!op || index >= op->num_resources) + return NULL; + + r = &op->archdata.resource[index]; + + return of_ioremap(r, 0, resource_size(r), (char *) r->name); +} +EXPORT_SYMBOL(of_iomap); + /* Take the archdata values for IOMMU, STC, and HOSTDATA found in * BUS and propagate to all child platform_device objects. */