summaryrefslogtreecommitdiff
path: root/drivers/core/read.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-08-26 01:12:30 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-08-29 23:56:17 +0900
commit7b8b47bd29c0d26c59e855164d23759fd1f89fc4 (patch)
tree9b1ac4d2f29914b2b6202f6b476b801d106fa2d1 /drivers/core/read.c
parent8b3cec7da18645eda7f7cd0b65ee9f2dac573409 (diff)
downloadu-boot-7b8b47bd29c0d26c59e855164d23759fd1f89fc4.tar.gz
ofnode: add {ofnode, dev}_read_resource_byname()
Linux supports platform_get_resource_byname() to look up a resource by name. We want a similar helper. It is useful when a device node has named register regions. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r--drivers/core/read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c
index fe40bed64d..6acb33388f 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -164,3 +164,9 @@ int dev_read_resource(struct udevice *dev, uint index, struct resource *res)
{
return ofnode_read_resource(dev_ofnode(dev), index, res);
}
+
+int dev_read_resource_byname(struct udevice *dev, const char *name,
+ struct resource *res)
+{
+ return ofnode_read_resource_byname(dev_ofnode(dev), name, res);
+}