summaryrefslogtreecommitdiffstats
path: root/include/device.h
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-04-06 14:01:57 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-04-07 14:51:34 +1000
commit510e2b066b172a4b46e18315ddac30721b5a7526 (patch)
treeca54208f3e3b3e85db3bb79461c9101e47e4e40b /include/device.h
parent47a4831befa13e8fa4da0529a233415e5a43ac5f (diff)
downloadblackbird-skiboot-510e2b066b172a4b46e18315ddac30721b5a7526.tar.gz
blackbird-skiboot-510e2b066b172a4b46e18315ddac30721b5a7526.zip
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/device.h')
-rw-r--r--include/device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h
index 1ad403f1..5155daad 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 */
OpenPOWER on IntegriCloud