• Home
  • Raw
  • Download

Lines Matching +full:bool +full:- +full:property

17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
26 fprintf(stderr, "=== %s: ", (c)->name); \
49 bool warn, error;
51 bool inprogress;
77 struct property *prop, in check_msg()
83 if ((c->warn && (quiet < 1)) in check_msg()
84 || (c->error && (quiet < 2))) { in check_msg()
86 strcmp(dti->outname, "-") ? dti->outname : "<stdout>", in check_msg()
87 (c->error) ? "ERROR" : "Warning", c->name); in check_msg()
89 fprintf(stderr, "%s", node->fullpath); in check_msg()
91 fprintf(stderr, ":%s", prop->name); in check_msg()
103 (c)->status = FAILED; \
110 (c)->status = FAILED; \
119 TRACE(c, "%s", node->fullpath); in check_nodes_props()
120 if (c->fn) in check_nodes_props()
121 c->fn(c, dti, node); in check_nodes_props()
127 static bool run_check(struct check *c, struct dt_info *dti) in run_check()
129 struct node *dt = dti->dt; in run_check()
130 bool error = false; in run_check()
133 assert(!c->inprogress); in run_check()
135 if (c->status != UNCHECKED) in run_check()
138 c->inprogress = true; in run_check()
140 for (i = 0; i < c->num_prereqs; i++) { in run_check()
141 struct check *prq = c->prereq[i]; in run_check()
143 if (prq->status != PASSED) { in run_check()
144 c->status = PREREQ; in run_check()
146 c->prereq[i]->name); in run_check()
150 if (c->status != UNCHECKED) in run_check()
155 if (c->status == UNCHECKED) in run_check()
156 c->status = PASSED; in run_check()
158 TRACE(c, "\tCompleted, status %d", c->status); in run_check()
161 c->inprogress = false; in run_check()
162 if ((c->status != PASSED) && (c->error)) in run_check()
182 struct property *prop; in check_is_string()
183 char *propname = c->data; in check_is_string()
189 if (!data_is_one_string(prop->val)) in check_is_string()
190 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
201 struct property *prop; in check_is_string_list()
202 char *propname = c->data; in check_is_string_list()
209 str = prop->val.val; in check_is_string_list()
210 rem = prop->val.len; in check_is_string_list()
214 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
217 rem -= l + 1; in check_is_string_list()
229 struct property *prop; in check_is_cell()
230 char *propname = c->data; in check_is_cell()
236 if (prop->val.len != sizeof(cell_t)) in check_is_cell()
237 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
254 for (child2 = child->next_sibling; in check_duplicate_node_names()
256 child2 = child2->next_sibling) in check_duplicate_node_names()
257 if (streq(child->name, child2->name)) in check_duplicate_node_names()
265 struct property *prop, *prop2; in check_duplicate_property_names()
268 for (prop2 = prop->next; prop2; prop2 = prop2->next) { in check_duplicate_property_names()
269 if (prop2->deleted) in check_duplicate_property_names()
271 if (streq(prop->name, prop2->name)) in check_duplicate_property_names()
272 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
281 #define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-"
282 #define PROPNODECHARSSTRICT LOWERCASE UPPERCASE DIGITS ",-"
287 int n = strspn(node->name, c->data); in check_node_name_chars()
289 if (n < strlen(node->name)) in check_node_name_chars()
291 node->name[n]); in check_node_name_chars()
298 int n = strspn(node->name, c->data); in check_node_name_chars_strict()
300 if (n < node->basenamelen) in check_node_name_chars_strict()
302 node->name[n]); in check_node_name_chars_strict()
318 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg()
327 if (prop && !prop->val.len) in check_unit_address_vs_reg()
333 FAIL(c, dti, node, "node has a reg or ranges property, but no unit name"); in check_unit_address_vs_reg()
336 FAIL(c, dti, node, "node has a unit name, but no reg property"); in check_unit_address_vs_reg()
344 struct property *prop; in check_property_name_chars()
347 int n = strspn(prop->name, c->data); in check_property_name_chars()
349 if (n < strlen(prop->name)) in check_property_name_chars()
350 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
351 prop->name[n]); in check_property_name_chars()
360 struct property *prop; in check_property_name_chars_strict()
363 const char *name = prop->name; in check_property_name_chars_strict()
364 int n = strspn(name, c->data); in check_property_name_chars_strict()
366 if (n == strlen(prop->name)) in check_property_name_chars_strict()
374 * # is only allowed at the beginning of property names not counting in check_property_name_chars_strict()
377 if (name[n] == '#' && ((n == 0) || (name[n-1] == ','))) { in check_property_name_chars_strict()
379 n = strspn(name, c->data); in check_property_name_chars_strict()
382 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
392 ((prop) ? (prop)->name : ""), \
393 ((prop) ? "' in " : ""), (node)->fullpath
397 struct property *prop, struct marker *mark) in check_duplicate_label()
399 struct node *dt = dti->dt; in check_duplicate_label()
401 struct property *otherprop = NULL; in check_duplicate_label()
426 struct property *prop; in check_duplicate_label_node()
428 for_each_label(node->labels, l) in check_duplicate_label_node()
429 check_duplicate_label(c, dti, l->label, node, NULL, NULL); in check_duplicate_label_node()
432 struct marker *m = prop->val.markers; in check_duplicate_label_node()
434 for_each_label(prop->labels, l) in check_duplicate_label_node()
435 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
438 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
446 struct node *root = dti->dt; in check_phandle_prop()
447 struct property *prop; in check_phandle_prop()
455 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
456 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
457 prop->val.len, prop->name); in check_phandle_prop()
461 m = prop->val.markers; in check_phandle_prop()
463 assert(m->offset == 0); in check_phandle_prop()
464 if (node != get_node_by_ref(root, m->ref)) in check_phandle_prop()
469 prop->name); in check_phandle_prop()
472 * phandle is allowed - that means allocate a unique in check_phandle_prop()
481 if ((phandle == 0) || (phandle == -1)) { in check_phandle_prop()
482 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
483 phandle, prop->name); in check_phandle_prop()
493 struct node *root = dti->dt; in check_explicit_phandles()
498 assert(!node->phandle); in check_explicit_phandles()
518 phandle, other->fullpath); in check_explicit_phandles()
522 node->phandle = phandle; in check_explicit_phandles()
529 struct property **pp, *prop = NULL; in check_name_properties()
531 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
532 if (streq((*pp)->name, "name")) { in check_name_properties()
538 return; /* No name property, that's fine */ in check_name_properties()
540 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
541 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
542 FAIL(c, dti, node, "\"name\" property is incorrect (\"%s\" instead" in check_name_properties()
543 " of base node name)", prop->val.val); in check_name_properties()
545 /* The name property is correct, and therefore redundant. in check_name_properties()
547 *pp = prop->next; in check_name_properties()
548 free(prop->name); in check_name_properties()
549 data_free(prop->val); in check_name_properties()
563 struct node *dt = dti->dt; in fixup_phandle_references()
564 struct property *prop; in fixup_phandle_references()
567 struct marker *m = prop->val.markers; in fixup_phandle_references()
572 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
574 refnode = get_node_by_ref(dt, m->ref); in fixup_phandle_references()
576 if (!(dti->dtsflags & DTSF_PLUGIN)) in fixup_phandle_references()
577 FAIL(c, dti, node, "Reference to non-existent node or " in fixup_phandle_references()
578 "label \"%s\"\n", m->ref); in fixup_phandle_references()
580 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
586 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
598 struct node *dt = dti->dt; in fixup_path_references()
599 struct property *prop; in fixup_path_references()
602 struct marker *m = prop->val.markers; in fixup_path_references()
607 assert(m->offset <= prop->val.len); in fixup_path_references()
609 refnode = get_node_by_ref(dt, m->ref); in fixup_path_references()
611 FAIL(c, dti, node, "Reference to non-existent node or label \"%s\"\n", in fixup_path_references()
612 m->ref); in fixup_path_references()
616 path = refnode->fullpath; in fixup_path_references()
617 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
629 if (node->omit_if_unused && !node->is_referenced) in fixup_omit_unused_nodes()
637 WARNING_IF_NOT_CELL(address_cells_is_cell, "#address-cells");
638 WARNING_IF_NOT_CELL(size_cells_is_cell, "#size-cells");
639 WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells");
651 struct property *prop; in check_names_is_string_list()
654 const char *s = strrchr(prop->name, '-'); in check_names_is_string_list()
655 if (!s || !streq(s, "-names")) in check_names_is_string_list()
658 c->data = prop->name; in check_names_is_string_list()
667 struct property *prop; in check_alias_paths()
669 if (!streq(node->name, "aliases")) in check_alias_paths()
673 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
674 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
675 prop->val.val); in check_alias_paths()
678 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
679 FAIL(c, dti, node, "aliases property name must include only lowercase and '-'"); in check_alias_paths()
687 struct property *prop; in fixup_addr_size_cells()
689 node->addr_cells = -1; in fixup_addr_size_cells()
690 node->size_cells = -1; in fixup_addr_size_cells()
692 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
694 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
696 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
698 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
704 (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
706 (((n)->size_cells == -1) ? 1 : (n)->size_cells)
711 struct property *prop; in check_reg_format()
718 if (!node->parent) { in check_reg_format()
719 FAIL(c, dti, node, "Root node has a \"reg\" property"); in check_reg_format()
723 if (prop->val.len == 0) in check_reg_format()
724 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
726 addr_cells = node_addr_cells(node->parent); in check_reg_format()
727 size_cells = node_size_cells(node->parent); in check_reg_format()
730 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
731 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
732 "(#address-cells == %d, #size-cells == %d)", in check_reg_format()
733 prop->val.len, addr_cells, size_cells); in check_reg_format()
740 struct property *prop; in check_ranges_format()
747 if (!node->parent) { in check_ranges_format()
748 FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property"); in check_ranges_format()
752 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
753 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
758 if (prop->val.len == 0) { in check_ranges_format()
760 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
761 "#address-cells (%d) differs from %s (%d)", in check_ranges_format()
762 c_addr_cells, node->parent->fullpath, in check_ranges_format()
765 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
766 "#size-cells (%d) differs from %s (%d)", in check_ranges_format()
767 c_size_cells, node->parent->fullpath, in check_ranges_format()
769 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
770 FAIL_PROP(c, dti, node, prop, "\"ranges\" property has invalid length (%d bytes) " in check_ranges_format()
771 "(parent #address-cells == %d, child #address-cells == %d, " in check_ranges_format()
772 "#size-cells == %d)", prop->val.len, in check_ranges_format()
784 struct property *prop; in check_pci_bridge()
788 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
791 node->bus = &pci_bus; in check_pci_bridge()
793 if (!strprefixeq(node->name, node->basenamelen, "pci") && in check_pci_bridge()
794 !strprefixeq(node->name, node->basenamelen, "pcie")) in check_pci_bridge()
802 FAIL(c, dti, node, "incorrect #address-cells for PCI bridge"); in check_pci_bridge()
804 FAIL(c, dti, node, "incorrect #size-cells for PCI bridge"); in check_pci_bridge()
806 prop = get_property(node, "bus-range"); in check_pci_bridge()
810 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
814 cells = (cell_t *)prop->val.val; in check_pci_bridge()
825 struct property *prop; in check_pci_device_bus_num()
829 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_bus_num()
836 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
839 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
843 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
848 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
855 struct property *prop; in check_pci_device_reg()
861 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_reg()
866 FAIL(c, dti, node, "missing PCI reg property"); in check_pci_device_reg()
870 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
899 .name = "simple-bus",
902 static bool node_is_compatible(struct node *node, const char *compat) in node_is_compatible()
904 struct property *prop; in node_is_compatible()
911 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
912 str += strnlen(str, end - str) + 1) { in node_is_compatible()
913 if (strprefixeq(str, end - str, compat)) in node_is_compatible()
921 if (node_is_compatible(node, "simple-bus")) in check_simple_bus_bridge()
922 node->bus = &simple_bus; in check_simple_bus_bridge()
928 struct property *prop; in check_simple_bus_reg()
935 if (!node->parent || (node->parent->bus != &simple_bus)) in check_simple_bus_reg()
940 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
943 if (prop && prop->val.len) in check_simple_bus_reg()
945 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
949 if (node->parent->parent && !(node->bus == &simple_bus)) in check_simple_bus_reg()
950 FAIL(c, dti, node, "missing or empty reg/ranges property"); in check_simple_bus_reg()
954 size = node_addr_cells(node->parent); in check_simple_bus_reg()
955 while (size--) in check_simple_bus_reg()
960 FAIL(c, dti, node, "simple-bus unit address format error, expected \"%s\"", in check_simple_bus_reg()
970 if (node->parent && node->parent->bus) in check_unit_address_format()
993 struct property *reg, *ranges; in check_avoid_default_addr_size()
995 if (!node->parent) in check_avoid_default_addr_size()
1004 if (node->parent->addr_cells == -1) in check_avoid_default_addr_size()
1005 FAIL(c, dti, node, "Relying on default #address-cells value"); in check_avoid_default_addr_size()
1007 if (node->parent->size_cells == -1) in check_avoid_default_addr_size()
1008 FAIL(c, dti, node, "Relying on default #size-cells value"); in check_avoid_default_addr_size()
1016 struct property *prop; in check_avoid_unnecessary_addr_size()
1018 bool has_reg = false; in check_avoid_unnecessary_addr_size()
1020 if (!node->parent || node->addr_cells < 0 || node->size_cells < 0) in check_avoid_unnecessary_addr_size()
1023 if (get_property(node, "ranges") || !node->children) in check_avoid_unnecessary_addr_size()
1033 …FAIL(c, dti, node, "unnecessary #address-cells/#size-cells without \"ranges\" or child \"reg\" pro… in check_avoid_unnecessary_addr_size()
1042 if (node->addr_cells < 0 || node->size_cells < 0) in check_unique_unit_address()
1045 if (!node->children) in check_unique_unit_address()
1061 FAIL(c, dti, childb, "duplicate unit-address (also used in node %s)", childa->fullpath); in check_unique_unit_address()
1071 struct node *dt = dti->dt; in check_obsolete_chosen_interrupt_controller()
1073 struct property *prop; in check_obsolete_chosen_interrupt_controller()
1083 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1086 "/chosen has obsolete \"interrupt-controller\" property"); in check_obsolete_chosen_interrupt_controller()
1094 if (!streq(node->name, "chosen")) in check_chosen_node_is_root()
1097 if (node->parent != dti->dt) in check_chosen_node_is_root()
1105 struct property *prop; in check_chosen_node_bootargs()
1107 if (!streq(node->name, "chosen")) in check_chosen_node_bootargs()
1114 c->data = prop->name; in check_chosen_node_bootargs()
1122 struct property *prop; in check_chosen_node_stdout_path()
1124 if (!streq(node->name, "chosen")) in check_chosen_node_stdout_path()
1127 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1129 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1132 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1135 c->data = prop->name; in check_chosen_node_stdout_path()
1143 bool optional;
1149 struct property *prop, in check_property_phandle_args()
1152 struct node *root = dti->dt; in check_property_phandle_args()
1155 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1157 "property size (%d) is invalid, expected multiple of %zu", in check_property_phandle_args()
1158 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1162 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1164 struct property *cellprop; in check_property_phandle_args()
1169 * Some bindings use a cell value 0 or -1 to skip over optional in check_property_phandle_args()
1172 if (phandle == 0 || phandle == -1) { in check_property_phandle_args()
1174 if (dti->dtsflags & DTSF_PLUGIN) in check_property_phandle_args()
1182 if (prop->val.markers) { in check_property_phandle_args()
1183 struct marker *m = prop->val.markers; in check_property_phandle_args()
1185 if (m->offset == (cell * sizeof(cell_t))) in check_property_phandle_args()
1202 cellprop = get_property(provider_node, provider->cell_name); in check_property_phandle_args()
1205 } else if (provider->optional) { in check_property_phandle_args()
1208 FAIL(c, dti, node, "Missing property '%s' in node %s or bad phandle (referred from %s[%d])", in check_property_phandle_args()
1209 provider->cell_name, in check_property_phandle_args()
1210 provider_node->fullpath, in check_property_phandle_args()
1211 prop->name, cell); in check_property_phandle_args()
1215 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1217 "property size (%d) too small for cell size %d", in check_property_phandle_args()
1218 prop->val.len, cellsize); in check_property_phandle_args()
1227 struct provider *provider = c->data; in check_provider_cells_property()
1228 struct property *prop; in check_provider_cells_property()
1230 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1240 WARNING_PROPERTY_PHANDLE_CELLS(clocks, "clocks", "#clock-cells");
1241 WARNING_PROPERTY_PHANDLE_CELLS(cooling_device, "cooling-device", "#cooling-cells");
1242 WARNING_PROPERTY_PHANDLE_CELLS(dmas, "dmas", "#dma-cells");
1243 WARNING_PROPERTY_PHANDLE_CELLS(hwlocks, "hwlocks", "#hwlock-cells");
1244 WARNING_PROPERTY_PHANDLE_CELLS(interrupts_extended, "interrupts-extended", "#interrupt-cells");
1245 WARNING_PROPERTY_PHANDLE_CELLS(io_channels, "io-channels", "#io-channel-cells");
1246 WARNING_PROPERTY_PHANDLE_CELLS(iommus, "iommus", "#iommu-cells");
1247 WARNING_PROPERTY_PHANDLE_CELLS(mboxes, "mboxes", "#mbox-cells");
1248 WARNING_PROPERTY_PHANDLE_CELLS(msi_parent, "msi-parent", "#msi-cells", true);
1249 WARNING_PROPERTY_PHANDLE_CELLS(mux_controls, "mux-controls", "#mux-control-cells");
1250 WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells");
1251 WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells");
1252 WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells");
1253 WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells");
1254 WARNING_PROPERTY_PHANDLE_CELLS(sound_dai, "sound-dai", "#sound-dai-cells");
1255 WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells");
1257 static bool prop_is_gpio(struct property *prop) in prop_is_gpio()
1262 * *-gpios and *-gpio can appear in property names, in prop_is_gpio()
1265 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1268 str = strrchr(prop->name, '-'); in prop_is_gpio()
1272 str = prop->name; in prop_is_gpio()
1283 struct property *prop; in check_gpios_property()
1285 /* Skip GPIO hog nodes which have 'gpios' property */ in check_gpios_property()
1286 if (get_property(node, "gpio-hog")) in check_gpios_property()
1295 provider.prop_name = prop->name; in check_gpios_property()
1296 provider.cell_name = "#gpio-cells"; in check_gpios_property()
1308 struct property *prop; in check_deprecated_gpio_property()
1316 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1321 "'[*-]gpio' is deprecated, use '[*-]gpios' instead"); in check_deprecated_gpio_property()
1327 static bool node_is_interrupt_provider(struct node *node) in node_is_interrupt_provider()
1329 struct property *prop; in node_is_interrupt_provider()
1331 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1335 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1345 struct node *root = dti->dt; in check_interrupts_property()
1347 struct property *irq_prop, *prop = NULL; in check_interrupts_property()
1354 if (irq_prop->val.len % sizeof(cell_t)) in check_interrupts_property()
1356 irq_prop->val.len, sizeof(cell_t)); in check_interrupts_property()
1364 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1368 if ((phandle == 0 || phandle == -1) && in check_interrupts_property()
1369 (dti->dtsflags & DTSF_PLUGIN)) in check_interrupts_property()
1379 "Missing interrupt-controller or interrupt-map property"); in check_interrupts_property()
1384 parent = parent->parent; in check_interrupts_property()
1388 FAIL(c, dti, node, "Missing interrupt-parent"); in check_interrupts_property()
1392 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1394 FAIL(c, dti, irq_node, "Missing #interrupt-cells in interrupt-parent"); in check_interrupts_property()
1399 if (irq_prop->val.len % (irq_cells * sizeof(cell_t))) { in check_interrupts_property()
1402 irq_prop->val.len, (int)(irq_cells * sizeof(cell_t))); in check_interrupts_property()
1408 .name = "graph-port",
1412 .name = "graph-ports",
1421 if (!(strprefixeq(child->name, child->basenamelen, "endpoint") || in check_graph_nodes()
1422 get_property(child, "remote-endpoint"))) in check_graph_nodes()
1425 node->bus = &graph_port_bus; in check_graph_nodes()
1428 if (!node->parent->bus && in check_graph_nodes()
1429 (streq(node->parent->name, "ports") || get_property(node, "reg"))) in check_graph_nodes()
1430 node->parent->bus = &graph_ports_bus; in check_graph_nodes()
1444 if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus) in check_graph_child_address()
1448 struct property *prop = get_property(child, "reg"); in check_graph_child_address()
1450 /* No error if we have any non-zero unit address */ in check_graph_child_address()
1457 if (cnt == 1 && node->addr_cells != -1) in check_graph_child_address()
1458 …FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not nece… in check_graph_child_address()
1459 node->children->name); in check_graph_child_address()
1468 struct property *prop; in check_graph_reg()
1474 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1475 FAIL(c, dti, node, "graph node malformed 'reg' property"); in check_graph_reg()
1484 if (node->parent->addr_cells != 1) in check_graph_reg()
1485 FAIL_PROP(c, dti, node, get_property(node, "#address-cells"), in check_graph_reg()
1486 "graph node '#address-cells' is %d, must be 1", in check_graph_reg()
1487 node->parent->addr_cells); in check_graph_reg()
1488 if (node->parent->size_cells != 0) in check_graph_reg()
1489 FAIL_PROP(c, dti, node, get_property(node, "#size-cells"), in check_graph_reg()
1490 "graph node '#size-cells' is %d, must be 0", in check_graph_reg()
1491 node->parent->size_cells); in check_graph_reg()
1497 if (node->bus != &graph_port_bus) in check_graph_port()
1500 if (!strprefixeq(node->name, node->basenamelen, "port")) in check_graph_port()
1512 struct property *prop; in get_remote_endpoint()
1514 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1520 if (phandle == 0 || phandle == -1) in get_remote_endpoint()
1523 node = get_node_by_phandle(dti->dt, phandle); in get_remote_endpoint()
1535 if (!node->parent || node->parent->bus != &graph_port_bus) in check_graph_endpoint()
1538 if (!strprefixeq(node->name, node->basenamelen, "endpoint")) in check_graph_endpoint()
1549 remote_node->fullpath); in check_graph_endpoint()
1619 static void enable_warning_error(struct check *c, bool warn, bool error) in enable_warning_error()
1624 if ((warn && !c->warn) || (error && !c->error)) in enable_warning_error()
1625 for (i = 0; i < c->num_prereqs; i++) in enable_warning_error()
1626 enable_warning_error(c->prereq[i], warn, error); in enable_warning_error()
1628 c->warn = c->warn || warn; in enable_warning_error()
1629 c->error = c->error || error; in enable_warning_error()
1632 static void disable_warning_error(struct check *c, bool warn, bool error) in disable_warning_error()
1638 if ((warn && c->warn) || (error && c->error)) { in disable_warning_error()
1643 for (j = 0; j < cc->num_prereqs; j++) in disable_warning_error()
1644 if (cc->prereq[j] == c) in disable_warning_error()
1649 c->warn = c->warn && !warn; in disable_warning_error()
1650 c->error = c->error && !error; in disable_warning_error()
1653 void parse_checks_option(bool warn, bool error, const char *arg) in parse_checks_option()
1657 bool enable = true; in parse_checks_option()
1659 if ((strncmp(arg, "no-", 3) == 0) in parse_checks_option()
1668 if (streq(c->name, name)) { in parse_checks_option()
1680 void process_checks(bool force, struct dt_info *dti) in process_checks()
1688 if (c->warn || c->error) in process_checks()
1695 "(use -f to force output)\n"); in process_checks()