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);
125 static void check_nodes_props(struct check *c, struct node *dt, struct node *node) in check_nodes_props() argument
127 struct node *child; in check_nodes_props()
130 TRACE(c, "%s", node->fullpath); in check_nodes_props()
132 c->node_fn(c, dt, node); in check_nodes_props()
135 for_each_property(node, prop) { in check_nodes_props()
136 TRACE(c, "%s\t'%s'", node->fullpath, prop->name); in check_nodes_props()
137 c->prop_fn(c, dt, node, prop); in check_nodes_props()
140 for_each_child(node, child) in check_nodes_props()
144 static int run_check(struct check *c, struct node *dt) in run_check()
191 static inline void check_always_fail(struct check *c, struct node *dt) in check_always_fail()
197 static void check_is_string(struct check *c, struct node *root, in check_is_string()
198 struct node *node) in check_is_string() argument
203 prop = get_property(node, propname); in check_is_string()
209 propname, node->fullpath); in check_is_string()
216 static void check_is_cell(struct check *c, struct node *root, in check_is_cell()
217 struct node *node) in check_is_cell() argument
222 prop = get_property(node, propname); in check_is_cell()
228 propname, node->fullpath); in check_is_cell()
239 static void check_duplicate_node_names(struct check *c, struct node *dt, in check_duplicate_node_names()
240 struct node *node) in check_duplicate_node_names() argument
242 struct node *child, *child2; in check_duplicate_node_names()
244 for_each_child(node, child) in check_duplicate_node_names()
254 static void check_duplicate_property_names(struct check *c, struct node *dt, in check_duplicate_property_names()
255 struct node *node) in check_duplicate_property_names() argument
259 for_each_property(node, prop) { in check_duplicate_property_names()
265 prop->name, node->fullpath); in check_duplicate_property_names()
276 static void check_node_name_chars(struct check *c, struct node *dt, in check_node_name_chars()
277 struct node *node) in check_node_name_chars() argument
279 int n = strspn(node->name, c->data); in check_node_name_chars()
281 if (n < strlen(node->name)) in check_node_name_chars()
283 node->name[n], node->fullpath); in check_node_name_chars()
287 static void check_node_name_format(struct check *c, struct node *dt, in check_node_name_format()
288 struct node *node) in check_node_name_format() argument
290 if (strchr(get_unitname(node), '@')) in check_node_name_format()
292 node->fullpath); in check_node_name_format()
296 static void check_property_name_chars(struct check *c, struct node *dt, in check_property_name_chars()
297 struct node *node, struct property *prop) in check_property_name_chars() argument
303 prop->name[n], prop->name, node->fullpath); in check_property_name_chars()
308 #define DESCLABEL_ARGS(node,prop,mark) \ argument
312 ((prop) ? "' in " : ""), (node)->fullpath
314 static void check_duplicate_label(struct check *c, struct node *dt, in check_duplicate_label()
315 const char *label, struct node *node, in check_duplicate_label() argument
318 struct node *othernode = NULL; in check_duplicate_label()
333 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
336 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
340 static void check_duplicate_label_node(struct check *c, struct node *dt, in check_duplicate_label_node()
341 struct node *node) in check_duplicate_label_node() argument
345 for_each_label(node->labels, l) in check_duplicate_label_node()
346 check_duplicate_label(c, dt, l->label, node, NULL, NULL); in check_duplicate_label_node()
348 static void check_duplicate_label_prop(struct check *c, struct node *dt, in check_duplicate_label_prop()
349 struct node *node, struct property *prop) in check_duplicate_label_prop() argument
355 check_duplicate_label(c, dt, l->label, node, prop, NULL); in check_duplicate_label_prop()
358 check_duplicate_label(c, dt, m->ref, node, prop, m); in check_duplicate_label_prop()
363 static void check_explicit_phandles(struct check *c, struct node *root, in check_explicit_phandles()
364 struct node *node, struct property *prop) in check_explicit_phandles() argument
367 struct node *other; in check_explicit_phandles()
376 node->fullpath, prop->val.len, prop->name); in check_explicit_phandles()
383 if (node != get_node_by_ref(root, m->ref)) in check_explicit_phandles()
388 prop->name, node->fullpath); in check_explicit_phandles()
403 node->fullpath, phandle, prop->name); in check_explicit_phandles()
407 if (node->phandle && (node->phandle != phandle)) in check_explicit_phandles()
409 node->fullpath, prop->name); in check_explicit_phandles()
412 if (other && (other != node)) { in check_explicit_phandles()
414 node->fullpath, phandle, other->fullpath); in check_explicit_phandles()
418 node->phandle = phandle; in check_explicit_phandles()
422 static void check_name_properties(struct check *c, struct node *root, in check_name_properties()
423 struct node *node) in check_name_properties() argument
427 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
436 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
437 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
439 " of base node name)", node->fullpath, prop->val.val); in check_name_properties()
456 static void fixup_phandle_references(struct check *c, struct node *dt, in fixup_phandle_references()
457 struct node *node, struct property *prop) in fixup_phandle_references() argument
460 struct node *refnode; in fixup_phandle_references()
480 static void fixup_path_references(struct check *c, struct node *dt, in fixup_path_references()
481 struct node *node, struct property *prop) in fixup_path_references() argument
484 struct node *refnode; in fixup_path_references()
516 static void fixup_addr_size_cells(struct check *c, struct node *dt, in fixup_addr_size_cells()
517 struct node *node) in fixup_addr_size_cells() argument
521 node->addr_cells = -1; in fixup_addr_size_cells()
522 node->size_cells = -1; in fixup_addr_size_cells()
524 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
526 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
528 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
530 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
540 static void check_reg_format(struct check *c, struct node *dt, in check_reg_format()
541 struct node *node) in check_reg_format() argument
546 prop = get_property(node, "reg"); in check_reg_format()
550 if (!node->parent) { in check_reg_format()
556 FAIL(c, "\"reg\" property in %s is empty", node->fullpath); in check_reg_format()
558 addr_cells = node_addr_cells(node->parent); in check_reg_format()
559 size_cells = node_size_cells(node->parent); in check_reg_format()
565 node->fullpath, prop->val.len, addr_cells, size_cells); in check_reg_format()
569 static void check_ranges_format(struct check *c, struct node *dt, in check_ranges_format()
570 struct node *node) in check_ranges_format() argument
575 prop = get_property(node, "ranges"); in check_ranges_format()
579 if (!node->parent) { in check_ranges_format()
584 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
585 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
586 c_addr_cells = node_addr_cells(node); in check_ranges_format()
587 c_size_cells = node_size_cells(node); in check_ranges_format()
594 node->fullpath, c_addr_cells, node->parent->fullpath, in check_ranges_format()
599 node->fullpath, c_size_cells, node->parent->fullpath, in check_ranges_format()
604 "#size-cells == %d)", node->fullpath, prop->val.len, in check_ranges_format()
613 static void check_avoid_default_addr_size(struct check *c, struct node *dt, in check_avoid_default_addr_size()
614 struct node *node) in check_avoid_default_addr_size() argument
618 if (!node->parent) in check_avoid_default_addr_size()
621 reg = get_property(node, "reg"); in check_avoid_default_addr_size()
622 ranges = get_property(node, "ranges"); in check_avoid_default_addr_size()
627 if ((node->parent->addr_cells == -1)) in check_avoid_default_addr_size()
629 node->fullpath); in check_avoid_default_addr_size()
631 if ((node->parent->size_cells == -1)) in check_avoid_default_addr_size()
633 node->fullpath); in check_avoid_default_addr_size()
638 struct node *dt) in check_obsolete_chosen_interrupt_controller()
640 struct node *chosen; in check_obsolete_chosen_interrupt_controller()
738 struct node *dt = bi->dt; in process_checks()