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>
This commit is contained in:
Simon Glass
2017-07-25 08:29:55 -06:00
parent c61d0009fe
commit dcf988525f
5 changed files with 47 additions and 34 deletions

View File

@@ -15,6 +15,8 @@
/* Enable checks to protect against invalid calls */
#undef OF_CHECKS
struct resource;
/**
* ofnode - reference to a device tree node
*
@@ -605,4 +607,6 @@ int ofnode_read_simple_size_cells(ofnode node);
*/
bool ofnode_pre_reloc(ofnode node);
int ofnode_read_resource(ofnode node, uint index, struct resource *res);
#endif