Lines Matching refs:prop
63 struct property *prop, in check_msg() argument
74 if (prop && prop->srcpos) in check_msg()
75 pos = prop->srcpos; in check_msg()
93 if (prop) in check_msg()
94 xasprintf_append(&str, "%s:%s: ", node->fullpath, prop->name); in check_msg()
105 if (!prop && pos) { in check_msg()
126 #define FAIL_PROP(c, dti, node, prop, ...) \ argument
130 check_msg((c), dti, node, prop, __VA_ARGS__); \
201 struct property *prop; in check_is_string() local
204 prop = get_property(node, propname); in check_is_string()
205 if (!prop) in check_is_string()
208 if (!data_is_one_string(prop->val)) in check_is_string()
209 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
220 struct property *prop; in check_is_string_list() local
224 prop = get_property(node, propname); in check_is_string_list()
225 if (!prop) in check_is_string_list()
228 str = prop->val.val; in check_is_string_list()
229 rem = prop->val.len; in check_is_string_list()
233 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
248 struct property *prop; in check_is_cell() local
251 prop = get_property(node, propname); in check_is_cell()
252 if (!prop) in check_is_cell()
255 if (prop->val.len != sizeof(cell_t)) in check_is_cell()
256 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
284 struct property *prop, *prop2; in check_duplicate_property_names() local
286 for_each_property(node, prop) { in check_duplicate_property_names()
287 for (prop2 = prop->next; prop2; prop2 = prop2->next) { in check_duplicate_property_names()
290 if (streq(prop->name, prop2->name)) in check_duplicate_property_names()
291 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
337 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg() local
344 if (!prop) { in check_unit_address_vs_reg()
345 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
346 if (prop && !prop->val.len) in check_unit_address_vs_reg()
347 prop = NULL; in check_unit_address_vs_reg()
350 if (prop) { in check_unit_address_vs_reg()
363 struct property *prop; in check_property_name_chars() local
365 for_each_property(node, prop) { in check_property_name_chars()
366 int n = strspn(prop->name, c->data); in check_property_name_chars()
368 if (n < strlen(prop->name)) in check_property_name_chars()
369 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
370 prop->name[n]); in check_property_name_chars()
379 struct property *prop; in check_property_name_chars_strict() local
381 for_each_property(node, prop) { in check_property_name_chars_strict()
382 const char *name = prop->name; in check_property_name_chars_strict()
385 if (n == strlen(prop->name)) in check_property_name_chars_strict()
401 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
408 #define DESCLABEL_ARGS(node,prop,mark) \ argument
410 ((prop) ? "'" : ""), \
411 ((prop) ? (prop)->name : ""), \
412 ((prop) ? "' in " : ""), (node)->fullpath
416 struct property *prop, struct marker *mark) in check_duplicate_label() argument
434 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
437 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
445 struct property *prop; in check_duplicate_label_node() local
450 for_each_property(node, prop) { in check_duplicate_label_node()
451 struct marker *m = prop->val.markers; in check_duplicate_label_node()
453 for_each_label(prop->labels, l) in check_duplicate_label_node()
454 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
457 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
466 struct property *prop; in check_phandle_prop() local
470 prop = get_property(node, propname); in check_phandle_prop()
471 if (!prop) in check_phandle_prop()
474 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
475 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
476 prop->val.len, prop->name); in check_phandle_prop()
480 m = prop->val.markers; in check_phandle_prop()
488 prop->name); in check_phandle_prop()
498 phandle = propval_cell(prop); in check_phandle_prop()
501 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
502 phandle, prop->name); in check_phandle_prop()
548 struct property **pp, *prop = NULL; in check_name_properties() local
552 prop = *pp; in check_name_properties()
556 if (!prop) in check_name_properties()
559 if ((prop->val.len != node->basenamelen+1) in check_name_properties()
560 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
562 " of base node name)", prop->val.val); in check_name_properties()
566 *pp = prop->next; in check_name_properties()
567 free(prop->name); in check_name_properties()
568 data_free(prop->val); in check_name_properties()
569 free(prop); in check_name_properties()
583 struct property *prop; in fixup_phandle_references() local
585 for_each_property(node, prop) { in fixup_phandle_references()
586 struct marker *m = prop->val.markers; in fixup_phandle_references()
591 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
599 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
605 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
618 struct property *prop; in fixup_path_references() local
620 for_each_property(node, prop) { in fixup_path_references()
621 struct marker *m = prop->val.markers; in fixup_path_references()
626 assert(m->offset <= prop->val.len); in fixup_path_references()
636 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
672 struct property *prop; in check_names_is_string_list() local
674 for_each_property(node, prop) { in check_names_is_string_list()
675 const char *s = strrchr(prop->name, '-'); in check_names_is_string_list()
679 c->data = prop->name; in check_names_is_string_list()
688 struct property *prop; in check_alias_paths() local
693 for_each_property(node, prop) { in check_alias_paths()
694 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
695 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
696 prop->val.val); in check_alias_paths()
699 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
708 struct property *prop; in fixup_addr_size_cells() local
713 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
714 if (prop) in fixup_addr_size_cells()
715 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
717 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
718 if (prop) in fixup_addr_size_cells()
719 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
732 struct property *prop; in check_reg_format() local
735 prop = get_property(node, "reg"); in check_reg_format()
736 if (!prop) in check_reg_format()
744 if (prop->val.len == 0) in check_reg_format()
745 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
751 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
752 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
754 prop->val.len, addr_cells, size_cells); in check_reg_format()
761 struct property *prop; in check_ranges_format() local
764 prop = get_property(node, "ranges"); in check_ranges_format()
765 if (!prop) in check_ranges_format()
769 FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property"); in check_ranges_format()
779 if (prop->val.len == 0) { in check_ranges_format()
781 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
786 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
790 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
791 FAIL_PROP(c, dti, node, prop, "\"ranges\" property has invalid length (%d bytes) " in check_ranges_format()
793 "#size-cells == %d)", prop->val.len, in check_ranges_format()
805 struct property *prop; in check_pci_bridge() local
808 prop = get_property(node, "device_type"); in check_pci_bridge()
809 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
818 prop = get_property(node, "ranges"); in check_pci_bridge()
819 if (!prop) in check_pci_bridge()
827 prop = get_property(node, "bus-range"); in check_pci_bridge()
828 if (!prop) in check_pci_bridge()
831 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
832 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
835 cells = (cell_t *)prop->val.val; in check_pci_bridge()
837 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
839 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
846 struct property *prop; in check_pci_device_bus_num() local
853 prop = get_property(node, "reg"); in check_pci_device_bus_num()
854 if (!prop) in check_pci_device_bus_num()
857 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
860 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
861 if (!prop) { in check_pci_device_bus_num()
864 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
869 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
876 struct property *prop; in check_pci_device_reg() local
885 prop = get_property(node, "reg"); in check_pci_device_reg()
886 if (!prop) { in check_pci_device_reg()
891 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
893 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
900 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
902 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
925 struct property *prop; in node_is_compatible() local
928 prop = get_property(node, "compatible"); in node_is_compatible()
929 if (!prop) in node_is_compatible()
932 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
950 struct property *prop; in check_simple_bus_reg() local
960 prop = get_property(node, "reg"); in check_simple_bus_reg()
961 if (prop) in check_simple_bus_reg()
962 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
964 prop = get_property(node, "ranges"); in check_simple_bus_reg()
965 if (prop && prop->val.len) in check_simple_bus_reg()
967 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1019 struct property *prop; in check_i2c_bus_reg() local
1029 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1030 if (prop) in check_i2c_bus_reg()
1031 cells = (cell_t *)prop->val.val; in check_i2c_bus_reg()
1044 for (len = prop->val.len; len > 0; len -= 4) { in check_i2c_bus_reg()
1047 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1072 struct property *prop; in check_spi_bus_bridge() local
1073 for_each_property(child, prop) { in check_spi_bus_bridge()
1074 if (strprefixeq(prop->name, 4, "spi-")) { in check_spi_bus_bridge()
1101 struct property *prop; in check_spi_bus_reg() local
1113 prop = get_property(node, "reg"); in check_spi_bus_reg()
1114 if (prop) in check_spi_bus_reg()
1115 cells = (cell_t *)prop->val.val; in check_spi_bus_reg()
1181 struct property *prop; in check_avoid_unnecessary_addr_size() local
1192 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1193 if (prop) in check_avoid_unnecessary_addr_size()
1204 struct property *prop; in node_is_disabled() local
1206 prop = get_property(node, "status"); in node_is_disabled()
1207 if (prop) { in node_is_disabled()
1208 char *str = prop->val.val; in node_is_disabled()
1274 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1284 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1285 if (prop) in check_obsolete_chosen_interrupt_controller()
1286 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1306 struct property *prop; in check_chosen_node_bootargs() local
1311 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1312 if (!prop) in check_chosen_node_bootargs()
1315 c->data = prop->name; in check_chosen_node_bootargs()
1323 struct property *prop; in check_chosen_node_stdout_path() local
1328 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1329 if (!prop) { in check_chosen_node_stdout_path()
1330 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1331 if (!prop) in check_chosen_node_stdout_path()
1333 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1336 c->data = prop->name; in check_chosen_node_stdout_path()
1350 struct property *prop, in check_property_phandle_args() argument
1356 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1357 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1359 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1363 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1368 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1383 if (prop->val.markers) { in check_property_phandle_args()
1384 struct marker *m = prop->val.markers; in check_property_phandle_args()
1390 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1397 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1412 prop->name, cell); in check_property_phandle_args()
1416 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1417 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1419 prop->val.len, cellsize); in check_property_phandle_args()
1429 struct property *prop; in check_provider_cells_property() local
1431 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1432 if (!prop) in check_provider_cells_property()
1435 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1458 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1466 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1469 str = strrchr(prop->name, '-'); in prop_is_gpio()
1473 str = prop->name; in prop_is_gpio()
1484 struct property *prop; in check_gpios_property() local
1490 for_each_property(node, prop) { in check_gpios_property()
1493 if (!prop_is_gpio(prop)) in check_gpios_property()
1496 provider.prop_name = prop->name; in check_gpios_property()
1499 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1509 struct property *prop; in check_deprecated_gpio_property() local
1511 for_each_property(node, prop) { in check_deprecated_gpio_property()
1514 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1517 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1521 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1530 struct property *prop; in node_is_interrupt_provider() local
1532 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1533 if (prop) in node_is_interrupt_provider()
1536 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1537 if (prop) in node_is_interrupt_provider()
1548 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1559 while (parent && !prop) { in check_interrupts_property()
1565 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1566 if (prop) { in check_interrupts_property()
1567 phandle = propval_cell(prop); in check_interrupts_property()
1573 FAIL_PROP(c, dti, parent, prop, "Invalid phandle"); in check_interrupts_property()
1579 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1597 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1598 if (!prop) { in check_interrupts_property()
1603 irq_cells = propval_cell(prop); in check_interrupts_property()
1605 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1653 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1656 if (prop && propval_cell(prop) != 0) in check_graph_child_address()
1673 struct property *prop; in check_graph_reg() local
1675 prop = get_property(node, "reg"); in check_graph_reg()
1676 if (!prop || !unitname) in check_graph_reg()
1679 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1684 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1717 struct property *prop; in get_remote_endpoint() local
1719 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1720 if (!prop) in get_remote_endpoint()
1723 phandle = propval_cell(prop); in get_remote_endpoint()
1730 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()