Lines Matching refs:prop

77 					   struct property *prop,  in check_msg()  argument
90 if (prop) in check_msg()
91 fprintf(stderr, ":%s", prop->name); in check_msg()
107 #define FAIL_PROP(c, dti, node, prop, ...) \ argument
111 check_msg((c), dti, node, prop, __VA_ARGS__); \
182 struct property *prop; in check_is_string() local
185 prop = get_property(node, propname); in check_is_string()
186 if (!prop) 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() local
205 prop = get_property(node, propname); in check_is_string_list()
206 if (!prop) 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()
229 struct property *prop; in check_is_cell() local
232 prop = get_property(node, propname); in check_is_cell()
233 if (!prop) 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()
265 struct property *prop, *prop2; in check_duplicate_property_names() local
267 for_each_property(node, prop) { in check_duplicate_property_names()
268 for (prop2 = prop->next; prop2; prop2 = prop2->next) { 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()
318 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg() local
325 if (!prop) { in check_unit_address_vs_reg()
326 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
327 if (prop && !prop->val.len) in check_unit_address_vs_reg()
328 prop = NULL; in check_unit_address_vs_reg()
331 if (prop) { in check_unit_address_vs_reg()
344 struct property *prop; in check_property_name_chars() local
346 for_each_property(node, 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() local
362 for_each_property(node, prop) { in check_property_name_chars_strict()
363 const char *name = prop->name; in check_property_name_chars_strict()
366 if (n == strlen(prop->name)) 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()
389 #define DESCLABEL_ARGS(node,prop,mark) \ argument
391 ((prop) ? "'" : ""), \
392 ((prop) ? (prop)->name : ""), \
393 ((prop) ? "' in " : ""), (node)->fullpath
397 struct property *prop, struct marker *mark) in check_duplicate_label() argument
415 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
418 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
426 struct property *prop; in check_duplicate_label_node() local
431 for_each_property(node, prop) { 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()
447 struct property *prop; in check_phandle_prop() local
451 prop = get_property(node, propname); in check_phandle_prop()
452 if (!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()
469 prop->name); in check_phandle_prop()
479 phandle = propval_cell(prop); 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()
529 struct property **pp, *prop = NULL; in check_name_properties() local
533 prop = *pp; in check_name_properties()
537 if (!prop) 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()
543 " of base node name)", prop->val.val); 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()
550 free(prop); in check_name_properties()
564 struct property *prop; in fixup_phandle_references() local
566 for_each_property(node, 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()
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()
599 struct property *prop; in fixup_path_references() local
601 for_each_property(node, 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()
617 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
651 struct property *prop; in check_names_is_string_list() local
653 for_each_property(node, prop) { in check_names_is_string_list()
654 const char *s = strrchr(prop->name, '-'); 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() local
672 for_each_property(node, prop) { 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()
687 struct property *prop; in fixup_addr_size_cells() local
692 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
693 if (prop) 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()
697 if (prop) in fixup_addr_size_cells()
698 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
711 struct property *prop; in check_reg_format() local
714 prop = get_property(node, "reg"); in check_reg_format()
715 if (!prop) 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()
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()
733 prop->val.len, addr_cells, size_cells); in check_reg_format()
740 struct property *prop; in check_ranges_format() local
743 prop = get_property(node, "ranges"); in check_ranges_format()
744 if (!prop) in check_ranges_format()
748 FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property"); 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()
765 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " 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()
772 "#size-cells == %d)", prop->val.len, in check_ranges_format()
784 struct property *prop; in check_pci_bridge() local
787 prop = get_property(node, "device_type"); in check_pci_bridge()
788 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
797 prop = get_property(node, "ranges"); in check_pci_bridge()
798 if (!prop) in check_pci_bridge()
806 prop = get_property(node, "bus-range"); in check_pci_bridge()
807 if (!prop) in check_pci_bridge()
810 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
811 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
814 cells = (cell_t *)prop->val.val; in check_pci_bridge()
816 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
818 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
825 struct property *prop; in check_pci_device_bus_num() local
832 prop = get_property(node, "reg"); in check_pci_device_bus_num()
833 if (!prop) 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()
840 if (!prop) { 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() local
864 prop = get_property(node, "reg"); in check_pci_device_reg()
865 if (!prop) { in check_pci_device_reg()
870 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
872 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
879 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
881 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
904 struct property *prop; in node_is_compatible() local
907 prop = get_property(node, "compatible"); in node_is_compatible()
908 if (!prop) in node_is_compatible()
911 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
928 struct property *prop; in check_simple_bus_reg() local
938 prop = get_property(node, "reg"); in check_simple_bus_reg()
939 if (prop) in check_simple_bus_reg()
940 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
942 prop = get_property(node, "ranges"); 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()
1016 struct property *prop; in check_avoid_unnecessary_addr_size() local
1027 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1028 if (prop) in check_avoid_unnecessary_addr_size()
1073 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1083 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1084 if (prop) in check_obsolete_chosen_interrupt_controller()
1085 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1105 struct property *prop; in check_chosen_node_bootargs() local
1110 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1111 if (!prop) 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() local
1127 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1128 if (!prop) { in check_chosen_node_stdout_path()
1129 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1130 if (!prop) 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()
1149 struct property *prop, in check_property_phandle_args() argument
1155 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1156 FAIL_PROP(c, dti, node, prop, 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()
1167 phandle = propval_cell_n(prop, cell); 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()
1189 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1196 FAIL_PROP(c, dti, node, prop, 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()
1216 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1218 prop->val.len, cellsize); in check_property_phandle_args()
1228 struct property *prop; in check_provider_cells_property() local
1230 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1231 if (!prop) in check_provider_cells_property()
1234 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1257 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
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() local
1289 for_each_property(node, prop) { in check_gpios_property()
1292 if (!prop_is_gpio(prop)) in check_gpios_property()
1295 provider.prop_name = prop->name; in check_gpios_property()
1298 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1308 struct property *prop; in check_deprecated_gpio_property() local
1310 for_each_property(node, prop) { in check_deprecated_gpio_property()
1313 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1316 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1320 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1329 struct property *prop; in node_is_interrupt_provider() local
1331 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1332 if (prop) in node_is_interrupt_provider()
1335 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1336 if (prop) in node_is_interrupt_provider()
1347 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1358 while (parent && !prop) { in check_interrupts_property()
1364 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1365 if (prop) { in check_interrupts_property()
1366 phandle = propval_cell(prop); in check_interrupts_property()
1374 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1392 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1393 if (!prop) { in check_interrupts_property()
1398 irq_cells = propval_cell(prop); in check_interrupts_property()
1400 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1448 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1451 if (prop && propval_cell(prop) != 0) in check_graph_child_address()
1468 struct property *prop; in check_graph_reg() local
1470 prop = get_property(node, "reg"); in check_graph_reg()
1471 if (!prop || !unitname) in check_graph_reg()
1474 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1479 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1512 struct property *prop; in get_remote_endpoint() local
1514 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1515 if (!prop) in get_remote_endpoint()
1518 phandle = propval_cell(prop); in get_remote_endpoint()
1525 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()