MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dtb_node_read_prop

Function dtb_node_read_prop

components/legacy/fdt/src/dtb_base.c:98–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98const void *dtb_node_read_prop(const struct dtb_node *node, const char *propname, int *sizep)
99{
100 const char *val = NULL;
101 int len;
102
103 RT_ASSERT(dtb_node_valid(node));
104 debug("%s: %s: ", __func__, propname);
105
106 struct dtb_property *prop = dtb_node_get_dtb_node_property(node, propname, &len);
107
108 if (prop)
109 {
110 val = prop->value;
111 len = prop->size;
112 }
113
114 if (!val)
115 {
116 debug("<not found>\n");
117 if (sizep)
118 *sizep = -FDT_ERR_NOTFOUND;
119 return NULL;
120 }
121 if (sizep)
122 *sizep = len;
123
124 return val;
125}
126
127const char *dtb_node_read_string(const struct dtb_node *node, const char *propname)
128{

Callers 1

dtb_node_read_stringFunction · 0.85

Calls 2

dtb_node_validFunction · 0.85

Tested by

no test coverage detected