diff options
author | Simon Glass <sjg@chromium.org> | 2017-07-25 17:29:55 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-07-28 21:02:47 +0300 |
commit | dcf988525f6e2045b9122ba7c3bf6a9bf44f146e (patch) | |
tree | 066e1e3e7a3f2aaceb5e407f85cf2a39ff1b486d /drivers/core/read.c | |
parent | c61d0009feb966e0e93254a8c435a1889085e6b8 (diff) | |
download | u-boot-dcf988525f6e2045b9122ba7c3bf6a9bf44f146e.tar.xz |
dm: core: Add ofnode_read_resource()
We sometimes need to read a resource from an arbitrary node. In any case
for consistency we should not put the live-tree switching code in
a dev_read_...() function. Update this to suit.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r-- | drivers/core/read.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c index 8570583693..fe40bed64d 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -159,3 +159,8 @@ int dev_read_enabled(struct udevice *dev) return fdtdec_get_is_enabled(gd->fdt_blob, ofnode_to_offset(node)); } + +int dev_read_resource(struct udevice *dev, uint index, struct resource *res) +{ + return ofnode_read_resource(dev_ofnode(dev), index, res); +} |