Lines Matching refs:node

49 typedef void (*tree_check_fn)(struct check *c, struct node *dt);
50 typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
51 typedef void (*prop_check_fn)(struct check *c, struct node *dt,
52 struct node *node, struct property *prop);
114 static void check_nodes_props(struct check *c, struct node *dt, struct node *node) in check_nodes_props() argument
116 struct node *child; in check_nodes_props()
119 TRACE(c, "%s", node->fullpath); in check_nodes_props()
121 c->node_fn(c, dt, node); in check_nodes_props()
124 for_each_property(node, prop) { in check_nodes_props()
125 TRACE(c, "%s\t'%s'", node->fullpath, prop->name); in check_nodes_props()
126 c->prop_fn(c, dt, node, prop); in check_nodes_props()
129 for_each_child(node, child) in check_nodes_props()
133 static int run_check(struct check *c, struct node *dt) in run_check()
179 static void check_is_string(struct check *c, struct node *root, in check_is_string()
180 struct node *node) in check_is_string() argument
185 prop = get_property(node, propname); in check_is_string()
191 propname, node->fullpath); in check_is_string()
196 static void check_is_cell(struct check *c, struct node *root, in check_is_cell()
197 struct node *node) in check_is_cell() argument
202 prop = get_property(node, propname); in check_is_cell()
208 propname, node->fullpath); in check_is_cell()
217 static void check_duplicate_node_names(struct check *c, struct node *dt, in check_duplicate_node_names()
218 struct node *node) in check_duplicate_node_names() argument
220 struct node *child, *child2; in check_duplicate_node_names()
222 for_each_child(node, child) in check_duplicate_node_names()
232 static void check_duplicate_property_names(struct check *c, struct node *dt, in check_duplicate_property_names()
233 struct node *node) in check_duplicate_property_names() argument
237 for_each_property(node, prop) in check_duplicate_property_names()
241 prop->name, node->fullpath); in check_duplicate_property_names()
250 static void check_node_name_chars(struct check *c, struct node *dt, in check_node_name_chars()
251 struct node *node) in check_node_name_chars() argument
253 int n = strspn(node->name, c->data); in check_node_name_chars()
255 if (n < strlen(node->name)) in check_node_name_chars()
257 node->name[n], node->fullpath); in check_node_name_chars()
261 static void check_node_name_format(struct check *c, struct node *dt, in check_node_name_format()
262 struct node *node) in check_node_name_format() argument
264 if (strchr(get_unitname(node), '@')) in check_node_name_format()
266 node->fullpath); in check_node_name_format()
270 static void check_property_name_chars(struct check *c, struct node *dt, in check_property_name_chars()
271 struct node *node, struct property *prop) in check_property_name_chars() argument
277 prop->name[n], prop->name, node->fullpath); in check_property_name_chars()
282 #define DESCLABEL_ARGS(node,prop,mark) \ argument
286 ((prop) ? "' in " : ""), (node)->fullpath
288 static void check_duplicate_label(struct check *c, struct node *dt, in check_duplicate_label()
289 const char *label, struct node *node, in check_duplicate_label() argument
292 struct node *othernode = NULL; in check_duplicate_label()
307 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
310 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
314 static void check_duplicate_label_node(struct check *c, struct node *dt, in check_duplicate_label_node()
315 struct node *node) in check_duplicate_label_node() argument
319 for_each_label(node->labels, l) in check_duplicate_label_node()
320 check_duplicate_label(c, dt, l->label, node, NULL, NULL); in check_duplicate_label_node()
322 static void check_duplicate_label_prop(struct check *c, struct node *dt, in check_duplicate_label_prop()
323 struct node *node, struct property *prop) in check_duplicate_label_prop() argument
329 check_duplicate_label(c, dt, l->label, node, prop, NULL); in check_duplicate_label_prop()
332 check_duplicate_label(c, dt, m->ref, node, prop, m); in check_duplicate_label_prop()
337 static void check_explicit_phandles(struct check *c, struct node *root, in check_explicit_phandles()
338 struct node *node, struct property *prop) in check_explicit_phandles() argument
341 struct node *other; in check_explicit_phandles()
350 node->fullpath, prop->val.len, prop->name); in check_explicit_phandles()
357 if (node != get_node_by_ref(root, m->ref)) in check_explicit_phandles()
362 prop->name, node->fullpath); in check_explicit_phandles()
377 node->fullpath, phandle, prop->name); in check_explicit_phandles()
381 if (node->phandle && (node->phandle != phandle)) in check_explicit_phandles()
383 node->fullpath, prop->name); in check_explicit_phandles()
386 if (other && (other != node)) { in check_explicit_phandles()
388 node->fullpath, phandle, other->fullpath); in check_explicit_phandles()
392 node->phandle = phandle; in check_explicit_phandles()
396 static void check_name_properties(struct check *c, struct node *root, in check_name_properties()
397 struct node *node) in check_name_properties() argument
401 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
410 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
411 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
413 " of base node name)", node->fullpath, prop->val.val); in check_name_properties()
430 static void fixup_phandle_references(struct check *c, struct node *dt, in fixup_phandle_references()
431 struct node *node, struct property *prop) in fixup_phandle_references() argument
434 struct node *refnode; in fixup_phandle_references()
454 static void fixup_path_references(struct check *c, struct node *dt, in fixup_path_references()
455 struct node *node, struct property *prop) in fixup_path_references() argument
458 struct node *refnode; in fixup_path_references()
490 static void fixup_addr_size_cells(struct check *c, struct node *dt, in fixup_addr_size_cells()
491 struct node *node) in fixup_addr_size_cells() argument
495 node->addr_cells = -1; in fixup_addr_size_cells()
496 node->size_cells = -1; in fixup_addr_size_cells()
498 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
500 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
502 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
504 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
514 static void check_reg_format(struct check *c, struct node *dt, in check_reg_format()
515 struct node *node) in check_reg_format() argument
520 prop = get_property(node, "reg"); in check_reg_format()
524 if (!node->parent) { in check_reg_format()
530 FAIL(c, "\"reg\" property in %s is empty", node->fullpath); in check_reg_format()
532 addr_cells = node_addr_cells(node->parent); in check_reg_format()
533 size_cells = node_size_cells(node->parent); in check_reg_format()
539 node->fullpath, prop->val.len, addr_cells, size_cells); in check_reg_format()
543 static void check_ranges_format(struct check *c, struct node *dt, in check_ranges_format()
544 struct node *node) in check_ranges_format() argument
549 prop = get_property(node, "ranges"); in check_ranges_format()
553 if (!node->parent) { in check_ranges_format()
558 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
559 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
560 c_addr_cells = node_addr_cells(node); in check_ranges_format()
561 c_size_cells = node_size_cells(node); in check_ranges_format()
568 node->fullpath, c_addr_cells, node->parent->fullpath, in check_ranges_format()
573 node->fullpath, c_size_cells, node->parent->fullpath, in check_ranges_format()
578 "#size-cells == %d)", node->fullpath, prop->val.len, in check_ranges_format()
587 static void check_avoid_default_addr_size(struct check *c, struct node *dt, in check_avoid_default_addr_size()
588 struct node *node) in check_avoid_default_addr_size() argument
592 if (!node->parent) in check_avoid_default_addr_size()
595 reg = get_property(node, "reg"); in check_avoid_default_addr_size()
596 ranges = get_property(node, "ranges"); in check_avoid_default_addr_size()
601 if ((node->parent->addr_cells == -1)) in check_avoid_default_addr_size()
603 node->fullpath); in check_avoid_default_addr_size()
605 if ((node->parent->size_cells == -1)) in check_avoid_default_addr_size()
607 node->fullpath); in check_avoid_default_addr_size()
612 struct node *dt) in check_obsolete_chosen_interrupt_controller()
614 struct node *chosen; in check_obsolete_chosen_interrupt_controller()
649 struct node *dt = bi->dt; in process_checks()