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
320 if (!prop) { in check_unit_address_vs_reg()
321 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
322 if (prop && !prop->val.len) in check_unit_address_vs_reg()
323 prop = NULL; in check_unit_address_vs_reg()
326 if (prop) { in check_unit_address_vs_reg()
339 struct property *prop; in check_property_name_chars() local
341 for_each_property(node, prop) { in check_property_name_chars()
342 int n = strspn(prop->name, c->data); in check_property_name_chars()
344 if (n < strlen(prop->name)) in check_property_name_chars()
345 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
346 prop->name[n]); in check_property_name_chars()
355 struct property *prop; in check_property_name_chars_strict() local
357 for_each_property(node, prop) { in check_property_name_chars_strict()
358 const char *name = prop->name; in check_property_name_chars_strict()
361 if (n == strlen(prop->name)) in check_property_name_chars_strict()
377 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
384 #define DESCLABEL_ARGS(node,prop,mark) \ argument
386 ((prop) ? "'" : ""), \
387 ((prop) ? (prop)->name : ""), \
388 ((prop) ? "' in " : ""), (node)->fullpath
392 struct property *prop, struct marker *mark) in check_duplicate_label() argument
410 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
413 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
421 struct property *prop; in check_duplicate_label_node() local
426 for_each_property(node, prop) { in check_duplicate_label_node()
427 struct marker *m = prop->val.markers; in check_duplicate_label_node()
429 for_each_label(prop->labels, l) in check_duplicate_label_node()
430 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
433 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
442 struct property *prop; in check_phandle_prop() local
446 prop = get_property(node, propname); in check_phandle_prop()
447 if (!prop) in check_phandle_prop()
450 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
451 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
452 prop->val.len, prop->name); in check_phandle_prop()
456 m = prop->val.markers; in check_phandle_prop()
464 prop->name); in check_phandle_prop()
474 phandle = propval_cell(prop); in check_phandle_prop()
477 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
478 phandle, prop->name); in check_phandle_prop()
524 struct property **pp, *prop = NULL; in check_name_properties() local
528 prop = *pp; in check_name_properties()
532 if (!prop) in check_name_properties()
535 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
536 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
538 " of base node name)", prop->val.val); in check_name_properties()
542 *pp = prop->next; in check_name_properties()
543 free(prop->name); in check_name_properties()
544 data_free(prop->val); in check_name_properties()
545 free(prop); in check_name_properties()
559 struct property *prop; in fixup_phandle_references() local
561 for_each_property(node, prop) { in fixup_phandle_references()
562 struct marker *m = prop->val.markers; in fixup_phandle_references()
567 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
575 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
581 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
592 struct property *prop; in fixup_path_references() local
594 for_each_property(node, prop) { in fixup_path_references()
595 struct marker *m = prop->val.markers; in fixup_path_references()
600 assert(m->offset <= prop->val.len); in fixup_path_references()
610 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
634 struct property *prop; in check_names_is_string_list() local
636 for_each_property(node, prop) { in check_names_is_string_list()
637 const char *s = strrchr(prop->name, '-'); in check_names_is_string_list()
641 c->data = prop->name; in check_names_is_string_list()
650 struct property *prop; in check_alias_paths() local
655 for_each_property(node, prop) { in check_alias_paths()
656 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
657 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
658 prop->val.val); in check_alias_paths()
661 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
670 struct property *prop; in fixup_addr_size_cells() local
675 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
676 if (prop) in fixup_addr_size_cells()
677 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
679 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
680 if (prop) in fixup_addr_size_cells()
681 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
694 struct property *prop; in check_reg_format() local
697 prop = get_property(node, "reg"); in check_reg_format()
698 if (!prop) in check_reg_format()
706 if (prop->val.len == 0) in check_reg_format()
707 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
713 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
714 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
716 prop->val.len, addr_cells, size_cells); in check_reg_format()
723 struct property *prop; in check_ranges_format() local
726 prop = get_property(node, "ranges"); in check_ranges_format()
727 if (!prop) in check_ranges_format()
731 FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property"); in check_ranges_format()
741 if (prop->val.len == 0) { in check_ranges_format()
743 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
748 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
752 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
753 FAIL_PROP(c, dti, node, prop, "\"ranges\" property has invalid length (%d bytes) " in check_ranges_format()
755 "#size-cells == %d)", prop->val.len, in check_ranges_format()
767 struct property *prop; in check_pci_bridge() local
770 prop = get_property(node, "device_type"); in check_pci_bridge()
771 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
780 prop = get_property(node, "ranges"); in check_pci_bridge()
781 if (!prop) in check_pci_bridge()
789 prop = get_property(node, "bus-range"); in check_pci_bridge()
790 if (!prop) { in check_pci_bridge()
794 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
795 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
798 cells = (cell_t *)prop->val.val; in check_pci_bridge()
800 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
802 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
809 struct property *prop; in check_pci_device_bus_num() local
816 prop = get_property(node, "reg"); in check_pci_device_bus_num()
817 if (!prop) in check_pci_device_bus_num()
820 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
823 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
824 if (!prop) { in check_pci_device_bus_num()
827 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
832 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
839 struct property *prop; in check_pci_device_reg() local
848 prop = get_property(node, "reg"); in check_pci_device_reg()
849 if (!prop) { in check_pci_device_reg()
854 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
856 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
863 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
865 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
888 struct property *prop; in node_is_compatible() local
891 prop = get_property(node, "compatible"); in node_is_compatible()
892 if (!prop) in node_is_compatible()
895 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
912 struct property *prop; in check_simple_bus_reg() local
922 prop = get_property(node, "reg"); in check_simple_bus_reg()
923 if (prop) in check_simple_bus_reg()
924 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
926 prop = get_property(node, "ranges"); in check_simple_bus_reg()
927 if (prop && prop->val.len) in check_simple_bus_reg()
929 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1000 struct property *prop; in check_avoid_unnecessary_addr_size() local
1011 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1012 if (prop) in check_avoid_unnecessary_addr_size()
1027 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1037 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1038 if (prop) in check_obsolete_chosen_interrupt_controller()
1039 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1059 struct property *prop; in check_chosen_node_bootargs() local
1064 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1065 if (!prop) in check_chosen_node_bootargs()
1068 c->data = prop->name; in check_chosen_node_bootargs()
1076 struct property *prop; in check_chosen_node_stdout_path() local
1081 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1082 if (!prop) { in check_chosen_node_stdout_path()
1083 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1084 if (!prop) in check_chosen_node_stdout_path()
1086 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1089 c->data = prop->name; in check_chosen_node_stdout_path()
1103 struct property *prop, in check_property_phandle_args() argument
1109 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1110 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1112 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1116 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1121 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1136 if (prop->val.markers) { in check_property_phandle_args()
1137 struct marker *m = prop->val.markers; in check_property_phandle_args()
1143 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1150 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1165 prop->name, cell); in check_property_phandle_args()
1169 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1170 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1172 prop->val.len, cellsize); in check_property_phandle_args()
1182 struct property *prop; in check_provider_cells_property() local
1184 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1185 if (!prop) in check_provider_cells_property()
1188 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1211 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1219 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1222 str = strrchr(prop->name, '-'); in prop_is_gpio()
1226 str = prop->name; in prop_is_gpio()
1237 struct property *prop; in check_gpios_property() local
1243 for_each_property(node, prop) { in check_gpios_property()
1246 if (!prop_is_gpio(prop)) in check_gpios_property()
1249 provider.prop_name = prop->name; in check_gpios_property()
1252 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1262 struct property *prop; in check_deprecated_gpio_property() local
1264 for_each_property(node, prop) { in check_deprecated_gpio_property()
1267 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1270 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1274 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1283 struct property *prop; in node_is_interrupt_provider() local
1285 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1286 if (prop) in node_is_interrupt_provider()
1289 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1290 if (prop) in node_is_interrupt_provider()
1301 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1312 while (parent && !prop) { in check_interrupts_property()
1318 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1319 if (prop) { in check_interrupts_property()
1320 phandle = propval_cell(prop); in check_interrupts_property()
1328 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1346 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1347 if (!prop) { in check_interrupts_property()
1352 irq_cells = propval_cell(prop); in check_interrupts_property()
1354 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()