Lines Matching +full:dt +full:- +full:node
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 fprintf(stderr, "=== %s: ", (c)->name); \
43 typedef void (*check_fn)(struct check *c, struct dt_info *dti, struct node *node);
81 if ((c->warn && (quiet < 1)) in check_msg()
82 || (c->error && (quiet < 2))) { in check_msg()
84 strcmp(dti->outname, "-") ? dti->outname : "<stdout>", in check_msg()
85 (c->error) ? "ERROR" : "Warning", c->name); in check_msg()
95 (c)->status = FAILED; \
99 static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node) in check_nodes_props() argument
101 struct node *child; in check_nodes_props()
103 TRACE(c, "%s", node->fullpath); in check_nodes_props()
104 if (c->fn) in check_nodes_props()
105 c->fn(c, dti, node); in check_nodes_props()
107 for_each_child(node, child) in check_nodes_props()
113 struct node *dt = dti->dt; in run_check() local
117 assert(!c->inprogress); in run_check()
119 if (c->status != UNCHECKED) in run_check()
122 c->inprogress = true; in run_check()
124 for (i = 0; i < c->num_prereqs; i++) { in run_check()
125 struct check *prq = c->prereq[i]; in run_check()
127 if (prq->status != PASSED) { in run_check()
128 c->status = PREREQ; in run_check()
130 c->prereq[i]->name); in run_check()
134 if (c->status != UNCHECKED) in run_check()
137 check_nodes_props(c, dti, dt); in run_check()
139 if (c->status == UNCHECKED) in run_check()
140 c->status = PASSED; in run_check()
142 TRACE(c, "\tCompleted, status %d", c->status); in run_check()
145 c->inprogress = false; in run_check()
146 if ((c->status != PASSED) && (c->error)) in run_check()
157 struct node *node) in check_always_fail() argument
164 struct node *node) in check_is_string() argument
167 char *propname = c->data; in check_is_string()
169 prop = get_property(node, propname); in check_is_string()
173 if (!data_is_one_string(prop->val)) in check_is_string()
175 propname, node->fullpath); in check_is_string()
183 struct node *node) in check_is_cell() argument
186 char *propname = c->data; in check_is_cell()
188 prop = get_property(node, propname); in check_is_cell()
192 if (prop->val.len != sizeof(cell_t)) in check_is_cell()
194 propname, node->fullpath); in check_is_cell()
206 struct node *node) in check_duplicate_node_names() argument
208 struct node *child, *child2; in check_duplicate_node_names()
210 for_each_child(node, child) in check_duplicate_node_names()
211 for (child2 = child->next_sibling; in check_duplicate_node_names()
213 child2 = child2->next_sibling) in check_duplicate_node_names()
214 if (streq(child->name, child2->name)) in check_duplicate_node_names()
215 FAIL(c, dti, "Duplicate node name %s", in check_duplicate_node_names()
216 child->fullpath); in check_duplicate_node_names()
221 struct node *node) in check_duplicate_property_names() argument
225 for_each_property(node, prop) { in check_duplicate_property_names()
226 for (prop2 = prop->next; prop2; prop2 = prop2->next) { in check_duplicate_property_names()
227 if (prop2->deleted) in check_duplicate_property_names()
229 if (streq(prop->name, prop2->name)) in check_duplicate_property_names()
231 prop->name, node->fullpath); in check_duplicate_property_names()
240 #define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-"
241 #define PROPNODECHARSSTRICT LOWERCASE UPPERCASE DIGITS ",-"
244 struct node *node) in check_node_name_chars() argument
246 int n = strspn(node->name, c->data); in check_node_name_chars()
248 if (n < strlen(node->name)) in check_node_name_chars()
249 FAIL(c, dti, "Bad character '%c' in node %s", in check_node_name_chars()
250 node->name[n], node->fullpath); in check_node_name_chars()
255 struct node *node) in check_node_name_chars_strict() argument
257 int n = strspn(node->name, c->data); in check_node_name_chars_strict()
259 if (n < node->basenamelen) in check_node_name_chars_strict()
260 FAIL(c, dti, "Character '%c' not recommended in node %s", in check_node_name_chars_strict()
261 node->name[n], node->fullpath); in check_node_name_chars_strict()
266 struct node *node) in check_node_name_format() argument
268 if (strchr(get_unitname(node), '@')) in check_node_name_format()
269 FAIL(c, dti, "Node %s has multiple '@' characters in name", in check_node_name_format()
270 node->fullpath); in check_node_name_format()
275 struct node *node) in check_unit_address_vs_reg() argument
277 const char *unitname = get_unitname(node); in check_unit_address_vs_reg()
278 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg()
281 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
282 if (prop && !prop->val.len) in check_unit_address_vs_reg()
288 FAIL(c, dti, "Node %s has a reg or ranges property, but no unit name", in check_unit_address_vs_reg()
289 node->fullpath); in check_unit_address_vs_reg()
292 FAIL(c, dti, "Node %s has a unit name, but no reg property", in check_unit_address_vs_reg()
293 node->fullpath); in check_unit_address_vs_reg()
299 struct node *node) in check_property_name_chars() argument
303 for_each_property(node, prop) { in check_property_name_chars()
304 int n = strspn(prop->name, c->data); in check_property_name_chars()
306 if (n < strlen(prop->name)) in check_property_name_chars()
307 FAIL(c, dti, "Bad character '%c' in property name \"%s\", node %s", in check_property_name_chars()
308 prop->name[n], prop->name, node->fullpath); in check_property_name_chars()
315 struct node *node) in check_property_name_chars_strict() argument
319 for_each_property(node, prop) { in check_property_name_chars_strict()
320 const char *name = prop->name; in check_property_name_chars_strict()
321 int n = strspn(name, c->data); in check_property_name_chars_strict()
323 if (n == strlen(prop->name)) in check_property_name_chars_strict()
334 if (name[n] == '#' && ((n == 0) || (name[n-1] == ','))) { in check_property_name_chars_strict()
336 n = strspn(name, c->data); in check_property_name_chars_strict()
339 FAIL(c, dti, "Character '%c' not recommended in property name \"%s\", node %s", in check_property_name_chars_strict()
340 name[n], prop->name, node->fullpath); in check_property_name_chars_strict()
346 #define DESCLABEL_ARGS(node,prop,mark) \ argument
349 ((prop) ? (prop)->name : ""), \
350 ((prop) ? "' in " : ""), (node)->fullpath
353 const char *label, struct node *node, in check_duplicate_label() argument
356 struct node *dt = dti->dt; in check_duplicate_label() local
357 struct node *othernode = NULL; in check_duplicate_label()
361 othernode = get_node_by_label(dt, label); in check_duplicate_label()
364 otherprop = get_property_by_label(dt, label, &othernode); in check_duplicate_label()
366 othermark = get_marker_label(dt, label, &othernode, in check_duplicate_label()
372 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
375 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
380 struct node *node) in check_duplicate_label_node() argument
385 for_each_label(node->labels, l) in check_duplicate_label_node()
386 check_duplicate_label(c, dti, l->label, node, NULL, NULL); in check_duplicate_label_node()
388 for_each_property(node, prop) { in check_duplicate_label_node()
389 struct marker *m = prop->val.markers; in check_duplicate_label_node()
391 for_each_label(prop->labels, l) in check_duplicate_label_node()
392 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
395 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
401 struct node *node, const char *propname) in check_phandle_prop() argument
403 struct node *root = dti->dt; in check_phandle_prop()
408 prop = get_property(node, propname); in check_phandle_prop()
412 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
414 node->fullpath, prop->val.len, prop->name); in check_phandle_prop()
418 m = prop->val.markers; in check_phandle_prop()
420 assert(m->offset == 0); in check_phandle_prop()
421 if (node != get_node_by_ref(root, m->ref)) in check_phandle_prop()
422 /* "Set this node's phandle equal to some in check_phandle_prop()
423 * other node's phandle". That's nonsensical in check_phandle_prop()
425 FAIL(c, dti, "%s in %s is a reference to another node", in check_phandle_prop()
426 prop->name, node->fullpath); in check_phandle_prop()
428 /* But setting this node's phandle equal to its own in check_phandle_prop()
429 * phandle is allowed - that means allocate a unique in check_phandle_prop()
430 * phandle for this node, even if it's not otherwise in check_phandle_prop()
438 if ((phandle == 0) || (phandle == -1)) { in check_phandle_prop()
440 node->fullpath, phandle, prop->name); in check_phandle_prop()
448 struct node *node) in check_explicit_phandles() argument
450 struct node *root = dti->dt; in check_explicit_phandles()
451 struct node *other; in check_explicit_phandles()
455 assert(!node->phandle); in check_explicit_phandles()
457 phandle = check_phandle_prop(c, dti, node, "phandle"); in check_explicit_phandles()
459 linux_phandle = check_phandle_prop(c, dti, node, "linux,phandle"); in check_explicit_phandles()
467 " properties", node->fullpath); in check_explicit_phandles()
473 if (other && (other != node)) { in check_explicit_phandles()
475 node->fullpath, phandle, other->fullpath); in check_explicit_phandles()
479 node->phandle = phandle; in check_explicit_phandles()
484 struct node *node) in check_name_properties() argument
488 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
489 if (streq((*pp)->name, "name")) { in check_name_properties()
497 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
498 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
500 " of base node name)", node->fullpath, prop->val.val); in check_name_properties()
504 *pp = prop->next; in check_name_properties()
505 free(prop->name); in check_name_properties()
506 data_free(prop->val); in check_name_properties()
518 struct node *node) in fixup_phandle_references() argument
520 struct node *dt = dti->dt; in fixup_phandle_references() local
523 for_each_property(node, prop) { in fixup_phandle_references()
524 struct marker *m = prop->val.markers; in fixup_phandle_references()
525 struct node *refnode; in fixup_phandle_references()
529 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
531 refnode = get_node_by_ref(dt, m->ref); in fixup_phandle_references()
533 if (!(dti->dtsflags & DTSF_PLUGIN)) in fixup_phandle_references()
534 FAIL(c, dti, "Reference to non-existent node or " in fixup_phandle_references()
535 "label \"%s\"\n", m->ref); in fixup_phandle_references()
537 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
542 phandle = get_node_phandle(dt, refnode); in fixup_phandle_references()
543 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
551 struct node *node) in fixup_path_references() argument
553 struct node *dt = dti->dt; in fixup_path_references() local
556 for_each_property(node, prop) { in fixup_path_references()
557 struct marker *m = prop->val.markers; in fixup_path_references()
558 struct node *refnode; in fixup_path_references()
562 assert(m->offset <= prop->val.len); in fixup_path_references()
564 refnode = get_node_by_ref(dt, m->ref); in fixup_path_references()
566 FAIL(c, dti, "Reference to non-existent node or label \"%s\"\n", in fixup_path_references()
567 m->ref); in fixup_path_references()
571 path = refnode->fullpath; in fixup_path_references()
572 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
582 WARNING_IF_NOT_CELL(address_cells_is_cell, "#address-cells");
583 WARNING_IF_NOT_CELL(size_cells_is_cell, "#size-cells");
584 WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells");
591 struct node *node) in fixup_addr_size_cells() argument
595 node->addr_cells = -1; in fixup_addr_size_cells()
596 node->size_cells = -1; in fixup_addr_size_cells()
598 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
600 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
602 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
604 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
610 (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
612 (((n)->size_cells == -1) ? 1 : (n)->size_cells)
615 struct node *node) in check_reg_format() argument
620 prop = get_property(node, "reg"); in check_reg_format()
624 if (!node->parent) { in check_reg_format()
625 FAIL(c, dti, "Root node has a \"reg\" property"); in check_reg_format()
629 if (prop->val.len == 0) in check_reg_format()
630 FAIL(c, dti, "\"reg\" property in %s is empty", node->fullpath); in check_reg_format()
632 addr_cells = node_addr_cells(node->parent); in check_reg_format()
633 size_cells = node_size_cells(node->parent); in check_reg_format()
636 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
638 "(#address-cells == %d, #size-cells == %d)", in check_reg_format()
639 node->fullpath, prop->val.len, addr_cells, size_cells); in check_reg_format()
644 struct node *node) in check_ranges_format() argument
649 prop = get_property(node, "ranges"); in check_ranges_format()
653 if (!node->parent) { in check_ranges_format()
654 FAIL(c, dti, "Root node has a \"ranges\" property"); in check_ranges_format()
658 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
659 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
660 c_addr_cells = node_addr_cells(node); in check_ranges_format()
661 c_size_cells = node_size_cells(node); in check_ranges_format()
664 if (prop->val.len == 0) { in check_ranges_format()
667 "#address-cells (%d) differs from %s (%d)", in check_ranges_format()
668 node->fullpath, c_addr_cells, node->parent->fullpath, in check_ranges_format()
672 "#size-cells (%d) differs from %s (%d)", in check_ranges_format()
673 node->fullpath, c_size_cells, node->parent->fullpath, in check_ranges_format()
675 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
677 "(parent #address-cells == %d, child #address-cells == %d, " in check_ranges_format()
678 "#size-cells == %d)", node->fullpath, prop->val.len, in check_ranges_format()
688 static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_pci_bridge() argument
693 prop = get_property(node, "device_type"); in check_pci_bridge()
694 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
697 node->bus = &pci_bus; in check_pci_bridge()
699 if (!strneq(node->name, "pci", node->basenamelen) && in check_pci_bridge()
700 !strneq(node->name, "pcie", node->basenamelen)) in check_pci_bridge()
701 FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"", in check_pci_bridge()
702 node->fullpath); in check_pci_bridge()
704 prop = get_property(node, "ranges"); in check_pci_bridge()
706 FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a bridge)", in check_pci_bridge()
707 node->fullpath); in check_pci_bridge()
709 if (node_addr_cells(node) != 3) in check_pci_bridge()
710 FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge", in check_pci_bridge()
711 node->fullpath); in check_pci_bridge()
712 if (node_size_cells(node) != 2) in check_pci_bridge()
713 FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge", in check_pci_bridge()
714 node->fullpath); in check_pci_bridge()
716 prop = get_property(node, "bus-range"); in check_pci_bridge()
718 FAIL(c, dti, "Node %s missing bus-range for PCI bridge", in check_pci_bridge()
719 node->fullpath); in check_pci_bridge()
722 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
723 FAIL(c, dti, "Node %s bus-range must be 2 cells", in check_pci_bridge()
724 node->fullpath); in check_pci_bridge()
727 cells = (cell_t *)prop->val.val; in check_pci_bridge()
729 FAIL(c, dti, "Node %s bus-range 1st cell must be less than or equal to 2nd cell", in check_pci_bridge()
730 node->fullpath); in check_pci_bridge()
732 FAIL(c, dti, "Node %s bus-range maximum bus number must be less than 256", in check_pci_bridge()
733 node->fullpath); in check_pci_bridge()
738 static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_bus_num() argument
744 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_bus_num()
747 prop = get_property(node, "reg"); in check_pci_device_bus_num()
751 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
754 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
758 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
763 FAIL(c, dti, "Node %s PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
764 node->fullpath, bus_num, min_bus, max_bus); in check_pci_device_bus_num()
768 static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_reg() argument
771 const char *unitname = get_unitname(node); in check_pci_device_reg()
776 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_reg()
779 prop = get_property(node, "reg"); in check_pci_device_reg()
781 FAIL(c, dti, "Node %s missing PCI reg property", node->fullpath); in check_pci_device_reg()
785 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
787 FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 3 must be 0", in check_pci_device_reg()
788 node->fullpath); in check_pci_device_reg()
795 FAIL(c, dti, "Node %s PCI reg address is not configuration space", in check_pci_device_reg()
796 node->fullpath); in check_pci_device_reg()
798 FAIL(c, dti, "Node %s PCI reg config space address register number must be 0", in check_pci_device_reg()
799 node->fullpath); in check_pci_device_reg()
811 FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"", in check_pci_device_reg()
812 node->fullpath, unit_addr); in check_pci_device_reg()
817 .name = "simple-bus",
820 static bool node_is_compatible(struct node *node, const char *compat) in node_is_compatible() argument
825 prop = get_property(node, "compatible"); in node_is_compatible()
829 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
830 str += strnlen(str, end - str) + 1) { in node_is_compatible()
831 if (strneq(str, compat, end - str)) in node_is_compatible()
837 static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_bridge() argument
839 if (node_is_compatible(node, "simple-bus")) in check_simple_bus_bridge()
840 node->bus = &simple_bus; in check_simple_bus_bridge()
844 static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_reg() argument
847 const char *unitname = get_unitname(node); in check_simple_bus_reg()
853 if (!node->parent || (node->parent->bus != &simple_bus)) in check_simple_bus_reg()
856 prop = get_property(node, "reg"); in check_simple_bus_reg()
858 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
860 prop = get_property(node, "ranges"); in check_simple_bus_reg()
861 if (prop && prop->val.len) in check_simple_bus_reg()
863 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
867 if (node->parent->parent && !(node->bus == &simple_bus)) in check_simple_bus_reg()
868 FAIL(c, dti, "Node %s missing or empty reg/ranges property", node->fullpath); in check_simple_bus_reg()
872 size = node_addr_cells(node->parent); in check_simple_bus_reg()
873 while (size--) in check_simple_bus_reg()
878 FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"", in check_simple_bus_reg()
879 node->fullpath, unit_addr); in check_simple_bus_reg()
884 struct node *node) in check_unit_address_format() argument
886 const char *unitname = get_unitname(node); in check_unit_address_format()
888 if (node->parent && node->parent->bus) in check_unit_address_format()
895 FAIL(c, dti, "Node %s unit name should not have leading \"0x\"", in check_unit_address_format()
896 node->fullpath); in check_unit_address_format()
901 FAIL(c, dti, "Node %s unit name should not have leading 0s", in check_unit_address_format()
902 node->fullpath); in check_unit_address_format()
911 struct node *node) in check_avoid_default_addr_size() argument
915 if (!node->parent) in check_avoid_default_addr_size()
916 return; /* Ignore root node */ in check_avoid_default_addr_size()
918 reg = get_property(node, "reg"); in check_avoid_default_addr_size()
919 ranges = get_property(node, "ranges"); in check_avoid_default_addr_size()
924 if (node->parent->addr_cells == -1) in check_avoid_default_addr_size()
925 FAIL(c, dti, "Relying on default #address-cells value for %s", in check_avoid_default_addr_size()
926 node->fullpath); in check_avoid_default_addr_size()
928 if (node->parent->size_cells == -1) in check_avoid_default_addr_size()
929 FAIL(c, dti, "Relying on default #size-cells value for %s", in check_avoid_default_addr_size()
930 node->fullpath); in check_avoid_default_addr_size()
937 struct node *node) in check_obsolete_chosen_interrupt_controller() argument
939 struct node *dt = dti->dt; in check_obsolete_chosen_interrupt_controller() local
940 struct node *chosen; in check_obsolete_chosen_interrupt_controller()
943 if (node != dt) in check_obsolete_chosen_interrupt_controller()
947 chosen = get_node_by_path(dt, "/chosen"); in check_obsolete_chosen_interrupt_controller()
951 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
953 FAIL(c, dti, "/chosen has obsolete \"interrupt-controller\" " in check_obsolete_chosen_interrupt_controller()
967 struct node *node, in check_property_phandle_args() argument
971 struct node *root = dti->dt; in check_property_phandle_args()
974 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
975 FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", in check_property_phandle_args()
976 prop->name, prop->val.len, sizeof(cell_t), node->fullpath); in check_property_phandle_args()
980 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
981 struct node *provider_node; in check_property_phandle_args()
987 * Some bindings use a cell value 0 or -1 to skip over optional in check_property_phandle_args()
990 if (phandle == 0 || phandle == -1) { in check_property_phandle_args()
996 if (prop->val.markers) { in check_property_phandle_args()
997 struct marker *m = prop->val.markers; in check_property_phandle_args()
999 if (m->offset == (cell * sizeof(cell_t))) in check_property_phandle_args()
1004 prop->name, cell, node->fullpath); in check_property_phandle_args()
1009 FAIL(c, dti, "Could not get phandle node for %s:%s(cell %d)", in check_property_phandle_args()
1010 node->fullpath, prop->name, cell); in check_property_phandle_args()
1014 cellprop = get_property(provider_node, provider->cell_name); in check_property_phandle_args()
1017 } else if (provider->optional) { in check_property_phandle_args()
1020 FAIL(c, dti, "Missing property '%s' in node %s or bad phandle (referred from %s:%s[%d])", in check_property_phandle_args()
1021 provider->cell_name, in check_property_phandle_args()
1022 provider_node->fullpath, in check_property_phandle_args()
1023 node->fullpath, prop->name, cell); in check_property_phandle_args()
1027 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1029 prop->name, prop->val.len, cellsize, node->fullpath); in check_property_phandle_args()
1036 struct node *node) in check_provider_cells_property() argument
1038 struct provider *provider = c->data; in check_provider_cells_property()
1041 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1045 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1051 WARNING_PROPERTY_PHANDLE_CELLS(clocks, "clocks", "#clock-cells");
1052 WARNING_PROPERTY_PHANDLE_CELLS(cooling_device, "cooling-device", "#cooling-cells");
1053 WARNING_PROPERTY_PHANDLE_CELLS(dmas, "dmas", "#dma-cells");
1054 WARNING_PROPERTY_PHANDLE_CELLS(hwlocks, "hwlocks", "#hwlock-cells");
1055 WARNING_PROPERTY_PHANDLE_CELLS(interrupts_extended, "interrupts-extended", "#interrupt-cells");
1056 WARNING_PROPERTY_PHANDLE_CELLS(io_channels, "io-channels", "#io-channel-cells");
1057 WARNING_PROPERTY_PHANDLE_CELLS(iommus, "iommus", "#iommu-cells");
1058 WARNING_PROPERTY_PHANDLE_CELLS(mboxes, "mboxes", "#mbox-cells");
1059 WARNING_PROPERTY_PHANDLE_CELLS(msi_parent, "msi-parent", "#msi-cells", true);
1060 WARNING_PROPERTY_PHANDLE_CELLS(mux_controls, "mux-controls", "#mux-control-cells");
1061 WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells");
1062 WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells");
1063 WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells");
1064 WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells");
1065 WARNING_PROPERTY_PHANDLE_CELLS(sound_dais, "sound-dais", "#sound-dai-cells");
1066 WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells");
1073 * *-gpios and *-gpio can appear in property names, in prop_is_gpio()
1076 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1079 str = strrchr(prop->name, '-'); in prop_is_gpio()
1083 str = prop->name; in prop_is_gpio()
1092 struct node *node) in check_gpios_property() argument
1097 if (get_property(node, "gpio-hog")) in check_gpios_property()
1100 for_each_property(node, prop) { in check_gpios_property()
1106 provider.prop_name = prop->name; in check_gpios_property()
1107 provider.cell_name = "#gpio-cells"; in check_gpios_property()
1109 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1117 struct node *node) in check_deprecated_gpio_property() argument
1121 for_each_property(node, prop) { in check_deprecated_gpio_property()
1127 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1131 FAIL(c, dti, "'[*-]gpio' is deprecated, use '[*-]gpios' instead for %s:%s", in check_deprecated_gpio_property()
1132 node->fullpath, prop->name); in check_deprecated_gpio_property()
1138 static bool node_is_interrupt_provider(struct node *node) in node_is_interrupt_provider() argument
1142 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1146 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1154 struct node *node) in check_interrupts_property() argument
1156 struct node *root = dti->dt; in check_interrupts_property()
1157 struct node *irq_node = NULL, *parent = node; in check_interrupts_property()
1161 irq_prop = get_property(node, "interrupts"); in check_interrupts_property()
1165 if (irq_prop->val.len % sizeof(cell_t)) in check_interrupts_property()
1166 FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", in check_interrupts_property()
1167 irq_prop->name, irq_prop->val.len, sizeof(cell_t), in check_interrupts_property()
1168 node->fullpath); in check_interrupts_property()
1171 if (parent != node && node_is_interrupt_provider(parent)) { in check_interrupts_property()
1176 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1181 FAIL(c, dti, "Bad interrupt-parent phandle for %s", in check_interrupts_property()
1182 node->fullpath); in check_interrupts_property()
1187 "Missing interrupt-controller or interrupt-map property in %s", in check_interrupts_property()
1188 irq_node->fullpath); in check_interrupts_property()
1193 parent = parent->parent; in check_interrupts_property()
1197 FAIL(c, dti, "Missing interrupt-parent for %s", node->fullpath); in check_interrupts_property()
1201 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1203 FAIL(c, dti, "Missing #interrupt-cells in interrupt-parent %s", in check_interrupts_property()
1204 irq_node->fullpath); in check_interrupts_property()
1209 if (irq_prop->val.len % (irq_cells * sizeof(cell_t))) { in check_interrupts_property()
1212 irq_prop->val.len, (int)(irq_cells * sizeof(cell_t)), in check_interrupts_property()
1213 node->fullpath); in check_interrupts_property()
1278 if ((warn && !c->warn) || (error && !c->error)) in enable_warning_error()
1279 for (i = 0; i < c->num_prereqs; i++) in enable_warning_error()
1280 enable_warning_error(c->prereq[i], warn, error); in enable_warning_error()
1282 c->warn = c->warn || warn; in enable_warning_error()
1283 c->error = c->error || error; in enable_warning_error()
1292 if ((warn && c->warn) || (error && c->error)) { in disable_warning_error()
1297 for (j = 0; j < cc->num_prereqs; j++) in disable_warning_error()
1298 if (cc->prereq[j] == c) in disable_warning_error()
1303 c->warn = c->warn && !warn; in disable_warning_error()
1304 c->error = c->error && !error; in disable_warning_error()
1313 if ((strncmp(arg, "no-", 3) == 0) in parse_checks_option()
1322 if (streq(c->name, name)) { in parse_checks_option()
1342 if (c->warn || c->error) in process_checks()
1349 "(use -f to force output)\n"); in process_checks()