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

Function ofw_node_destroy

components/drivers/ofw/base.c:187–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187static void ofw_node_destroy(struct rt_ofw_node *np)
188{
189 struct rt_ofw_node *prev;
190
191 if (np->parent)
192 {
193 /* Ask parent and prev sibling we are destroy. */
194 prev = np->parent->child;
195
196 if (prev == np)
197 {
198 np->parent->child = RT_NULL;
199 }
200 else
201 {
202 while (prev->sibling != np)
203 {
204 prev = prev->sibling;
205 }
206
207 prev->sibling = np->sibling;
208 }
209 }
210
211 while (np)
212 {
213 if (rt_ofw_node_test_flag(np, RT_OFW_F_SYSTEM) == RT_FALSE)
214 {
215 LOG_E("%s is system node", np->full_name);
216 RT_ASSERT(0);
217 }
218
219 prev = np;
220
221 np = ofw_get_next_node(np);
222
223 ofw_prop_destroy(prev->props);
224 rt_free(prev);
225 }
226}
227
228rt_err_t rt_ofw_node_destroy(struct rt_ofw_node *np)
229{

Callers 1

rt_ofw_node_destroyFunction · 0.85

Calls 4

rt_ofw_node_test_flagFunction · 0.85
ofw_get_next_nodeFunction · 0.85
ofw_prop_destroyFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected