diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-04-06 14:01:57 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-04-07 14:51:34 +1000 |
commit | 510e2b066b172a4b46e18315ddac30721b5a7526 (patch) | |
tree | ca54208f3e3b3e85db3bb79461c9101e47e4e40b /include | |
parent | 47a4831befa13e8fa4da0529a233415e5a43ac5f (diff) | |
download | skiboot-510e2b066b172a4b46e18315ddac30721b5a7526.zip skiboot-510e2b066b172a4b46e18315ddac30721b5a7526.tar.gz skiboot-510e2b066b172a4b46e18315ddac30721b5a7526.tar.bz2 |
device: add dt_find_by_name_addr
Adds two helper functions that allow device nodes to be found via
their name and unit address. One will take an integer address and
format it to a hex string while the other looks up the unit based
a user supplied string. This is handy in a few places inside the
HDAT parser.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h index 1ad403f..5155daa 100644 --- a/include/device.h +++ b/include/device.h @@ -247,4 +247,9 @@ u64 dt_translate_address(const struct dt_node *node, unsigned int index, */ int dt_cmp_subnodes(const struct dt_node *a, const struct dt_node *b); +struct dt_node *__dt_find_by_name_addr(struct dt_node *parent, const char *name, + const char *addr); +struct dt_node *dt_find_by_name_addr(struct dt_node *parent, const char *name, + uint64_t addr); + #endif /* __DEVICE_H */ |