#endif
}
+const __be32 *of_get_address_by_name(struct device_node *dev, const char *name,
+ u64 *size, unsigned int *flags)
+{
+ int index;
+ if (!name)
+ return NULL;
+
+ /* Try to read "reg-names" property and get the index by name */
+ index = of_property_match_string(dev, "reg-names", name);
+ if (index < 0)
+ return NULL;
+
+ return of_get_address(dev, index, size, flags);
+}
+EXPORT_SYMBOL(of_get_address_by_name);
+
static int __of_address_to_resource(struct device_node *dev,
const __be32 *addrp, u64 size, unsigned int flags,
const char *name, struct resource *r)
return false;
}
EXPORT_SYMBOL_GPL(of_dma_is_coherent);
+
+void __iomem *of_iomap_by_name(struct device_node *np, const char *name)
+{
+ int index;
+
+ if (!name)
+ return NULL;
+
+ /* Try to read "reg-names" property and get the index by name */
+ index = of_property_match_string(np, "reg-names", name);
+ if (index < 0)
+ return NULL;
+
+ return of_iomap(np, index);
+}
+EXPORT_SYMBOL(of_iomap_by_name);