Lines Matching refs:node

43 typedef void (*tree_check_fn)(struct check *c, struct node *dt);
44 typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
45 typedef void (*prop_check_fn)(struct check *c, struct node *dt,
46 struct node *node, struct property *prop);
126 static void check_nodes_props(struct check *c, struct node *dt, struct node *node) in check_nodes_props() argument
128 struct node *child; in check_nodes_props()
131 TRACE(c, "%s", node->fullpath); in check_nodes_props()
133 c->node_fn(c, dt, node); in check_nodes_props()
136 for_each_property(node, prop) { in check_nodes_props()
137 TRACE(c, "%s\t'%s'", node->fullpath, prop->name); in check_nodes_props()
138 c->prop_fn(c, dt, node, prop); in check_nodes_props()
141 for_each_child(node, child) in check_nodes_props()
145 static bool run_check(struct check *c, struct node *dt) in run_check()
192 static inline void check_always_fail(struct check *c, struct node *dt) in check_always_fail()
198 static void check_is_string(struct check *c, struct node *root, in check_is_string()
199 struct node *node) in check_is_string() argument
204 prop = get_property(node, propname); in check_is_string()
210 propname, node->fullpath); in check_is_string()
217 static void check_is_cell(struct check *c, struct node *root, in check_is_cell()
218 struct node *node) in check_is_cell() argument
223 prop = get_property(node, propname); in check_is_cell()
229 propname, node->fullpath); in check_is_cell()
240 static void check_duplicate_node_names(struct check *c, struct node *dt, in check_duplicate_node_names()
241 struct node *node) in check_duplicate_node_names() argument
243 struct node *child, *child2; in check_duplicate_node_names()
245 for_each_child(node, child) in check_duplicate_node_names()
255 static void check_duplicate_property_names(struct check *c, struct node *dt, in check_duplicate_property_names()
256 struct node *node) in check_duplicate_property_names() argument
260 for_each_property(node, prop) { in check_duplicate_property_names()
266 prop->name, node->fullpath); in check_duplicate_property_names()
277 static void check_node_name_chars(struct check *c, struct node *dt, in check_node_name_chars()
278 struct node *node) in check_node_name_chars() argument
280 int n = strspn(node->name, c->data); in check_node_name_chars()
282 if (n < strlen(node->name)) in check_node_name_chars()
284 node->name[n], node->fullpath); in check_node_name_chars()
288 static void check_node_name_format(struct check *c, struct node *dt, in check_node_name_format()
289 struct node *node) in check_node_name_format() argument
291 if (strchr(get_unitname(node), '@')) in check_node_name_format()
293 node->fullpath); in check_node_name_format()
297 static void check_property_name_chars(struct check *c, struct node *dt, in check_property_name_chars()
298 struct node *node, struct property *prop) in check_property_name_chars() argument
304 prop->name[n], prop->name, node->fullpath); in check_property_name_chars()
309 #define DESCLABEL_ARGS(node,prop,mark) \ argument
313 ((prop) ? "' in " : ""), (node)->fullpath
315 static void check_duplicate_label(struct check *c, struct node *dt, in check_duplicate_label()
316 const char *label, struct node *node, in check_duplicate_label() argument
319 struct node *othernode = NULL; in check_duplicate_label()
334 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
337 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
341 static void check_duplicate_label_node(struct check *c, struct node *dt, in check_duplicate_label_node()
342 struct node *node) in check_duplicate_label_node() argument
346 for_each_label(node->labels, l) in check_duplicate_label_node()
347 check_duplicate_label(c, dt, l->label, node, NULL, NULL); in check_duplicate_label_node()
349 static void check_duplicate_label_prop(struct check *c, struct node *dt, in check_duplicate_label_prop()
350 struct node *node, struct property *prop) in check_duplicate_label_prop() argument
356 check_duplicate_label(c, dt, l->label, node, prop, NULL); in check_duplicate_label_prop()
359 check_duplicate_label(c, dt, m->ref, node, prop, m); in check_duplicate_label_prop()
364 static void check_explicit_phandles(struct check *c, struct node *root, in check_explicit_phandles()
365 struct node *node, struct property *prop) in check_explicit_phandles() argument
368 struct node *other; in check_explicit_phandles()
377 node->fullpath, prop->val.len, prop->name); in check_explicit_phandles()
384 if (node != get_node_by_ref(root, m->ref)) in check_explicit_phandles()
389 prop->name, node->fullpath); in check_explicit_phandles()
404 node->fullpath, phandle, prop->name); in check_explicit_phandles()
408 if (node->phandle && (node->phandle != phandle)) in check_explicit_phandles()
410 node->fullpath, prop->name); in check_explicit_phandles()
413 if (other && (other != node)) { in check_explicit_phandles()
415 node->fullpath, phandle, other->fullpath); in check_explicit_phandles()
419 node->phandle = phandle; in check_explicit_phandles()
423 static void check_name_properties(struct check *c, struct node *root, in check_name_properties()
424 struct node *node) in check_name_properties() argument
428 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
437 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
438 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
440 " of base node name)", node->fullpath, prop->val.val); in check_name_properties()
457 static void fixup_phandle_references(struct check *c, struct node *dt, in fixup_phandle_references()
458 struct node *node, struct property *prop) in fixup_phandle_references() argument
461 struct node *refnode; in fixup_phandle_references()
481 static void fixup_path_references(struct check *c, struct node *dt, in fixup_path_references()
482 struct node *node, struct property *prop) in fixup_path_references() argument
485 struct node *refnode; in fixup_path_references()
517 static void fixup_addr_size_cells(struct check *c, struct node *dt, in fixup_addr_size_cells()
518 struct node *node) in fixup_addr_size_cells() argument
522 node->addr_cells = -1; in fixup_addr_size_cells()
523 node->size_cells = -1; in fixup_addr_size_cells()
525 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
527 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
529 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
531 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
541 static void check_reg_format(struct check *c, struct node *dt, in check_reg_format()
542 struct node *node) in check_reg_format() argument
547 prop = get_property(node, "reg"); in check_reg_format()
551 if (!node->parent) { in check_reg_format()
557 FAIL(c, "\"reg\" property in %s is empty", node->fullpath); in check_reg_format()
559 addr_cells = node_addr_cells(node->parent); in check_reg_format()
560 size_cells = node_size_cells(node->parent); in check_reg_format()
566 node->fullpath, prop->val.len, addr_cells, size_cells); in check_reg_format()
570 static void check_ranges_format(struct check *c, struct node *dt, in check_ranges_format()
571 struct node *node) in check_ranges_format() argument
576 prop = get_property(node, "ranges"); in check_ranges_format()
580 if (!node->parent) { in check_ranges_format()
585 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
586 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
587 c_addr_cells = node_addr_cells(node); in check_ranges_format()
588 c_size_cells = node_size_cells(node); in check_ranges_format()
595 node->fullpath, c_addr_cells, node->parent->fullpath, in check_ranges_format()
600 node->fullpath, c_size_cells, node->parent->fullpath, in check_ranges_format()
605 "#size-cells == %d)", node->fullpath, prop->val.len, in check_ranges_format()
614 static void check_avoid_default_addr_size(struct check *c, struct node *dt, in check_avoid_default_addr_size()
615 struct node *node) in check_avoid_default_addr_size() argument
619 if (!node->parent) in check_avoid_default_addr_size()
622 reg = get_property(node, "reg"); in check_avoid_default_addr_size()
623 ranges = get_property(node, "ranges"); in check_avoid_default_addr_size()
628 if (node->parent->addr_cells == -1) in check_avoid_default_addr_size()
630 node->fullpath); in check_avoid_default_addr_size()
632 if (node->parent->size_cells == -1) in check_avoid_default_addr_size()
634 node->fullpath); in check_avoid_default_addr_size()
639 struct node *dt) in check_obsolete_chosen_interrupt_controller()
641 struct node *chosen; in check_obsolete_chosen_interrupt_controller()
739 struct node *dt = bi->dt; in process_checks()