From 36dc312add5605137fbca70bd68f3deb4fb83858 Mon Sep 17 00:00:00 2001 From: Burt P Date: Wed, 19 Jul 2017 01:23:15 -0500 Subject: device tree: code comments and tweak dtr_str() * dtr_str() requires obj, which knows its dtr. Signed-off-by: Burt P --- includes/dt_util.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/dt_util.h b/includes/dt_util.h index e044def7..fdaf1c4c 100644 --- a/includes/dt_util.h +++ b/includes/dt_util.h @@ -42,15 +42,19 @@ dtr_obj *dtr_obj_read(dtr *, const char *dtp); void dtr_obj_free(dtr_obj *); int dtr_obj_type(dtr_obj *); char *dtr_obj_alias(dtr_obj *); -char *dtr_obj_path(dtr_obj *); -char *dtr_obj_full_path(dtr_obj *); +char *dtr_obj_path(dtr_obj *); /* device tree path */ +char *dtr_obj_full_path(dtr_obj *); /* system path */ -char* dtr_str(dtr *, dtr_obj *obj); +/* find property/node 'name' relative to node + * if node is NULL, then from root */ dtr_obj *dtr_get_prop_obj(dtr *, dtr_obj *node, const char *name); char *dtr_get_prop_str(dtr *, dtr_obj *node, const char *name); uint32_t dtr_get_prop_u32(dtr *, dtr_obj *node, const char *name); -static int dtr_guess_type(dtr_obj *obj); +/* attempts to render the object as a string */ +char* dtr_str(dtr_obj *obj); + +int dtr_guess_type(dtr_obj *obj); char *dtr_elem_phref(dtr *, dt_uint e); char *dtr_elem_hex(dt_uint e); char *dtr_elem_byte(uint8_t e); -- cgit v1.2.3