Commit 930952af authored by David S. Miller's avatar David S. Miller

sparc: Implement of_address_to_resource().

Similarly to irq_of_parse_and_map(), find the platform_device
object and return the pre-computed resource.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 16550680
...@@ -22,6 +22,19 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index) ...@@ -22,6 +22,19 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index)
} }
EXPORT_SYMBOL(irq_of_parse_and_map); EXPORT_SYMBOL(irq_of_parse_and_map);
int of_address_to_resource(struct device_node *node, int index,
struct resource *r)
{
struct platform_device *op = of_find_device_by_node(node);
if (!op || index >= op->num_resources)
return -EINVAL;
memcpy(r, &op->archdata.resource[index], sizeof(*r));
return 0;
}
EXPORT_SYMBOL_GPL(of_address_to_resource);
/* Take the archdata values for IOMMU, STC, and HOSTDATA found in /* Take the archdata values for IOMMU, STC, and HOSTDATA found in
* BUS and propagate to all child platform_device objects. * BUS and propagate to all child platform_device objects.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment