Skip to content

Commit

Permalink
sparc: Implement of_iomap().
Browse files Browse the repository at this point in the history
Grab the pre-computed resource and map using of_ioremap().

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 18, 2011
1 parent 930952a commit 9889376
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/sparc/kernel/of_device_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 9889376

Please sign in to comment.