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__); \
209 struct property *prop; in check_is_string() local
212 prop = get_property(node, propname); in check_is_string()
213 if (!prop) in check_is_string()
216 if (!data_is_one_string(prop->val)) in check_is_string()
217 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
228 struct property *prop; in check_is_string_list() local
232 prop = get_property(node, propname); in check_is_string_list()
233 if (!prop) in check_is_string_list()
236 str = prop->val.val; in check_is_string_list()
237 rem = prop->val.len; in check_is_string_list()
241 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
256 struct property *prop; in check_is_cell() local
259 prop = get_property(node, propname); in check_is_cell()
260 if (!prop) in check_is_cell()
263 if (prop->val.len != sizeof(cell_t)) in check_is_cell()
264 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
292 struct property *prop, *prop2; in check_duplicate_property_names() local
294 for_each_property(node, prop) { in check_duplicate_property_names()
295 for (prop2 = prop->next; prop2; prop2 = prop2->next) { in check_duplicate_property_names()
298 if (streq(prop->name, prop2->name)) in check_duplicate_property_names()
299 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
360 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg() local
367 if (!prop) { in check_unit_address_vs_reg()
368 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
369 if (prop && !prop->val.len) in check_unit_address_vs_reg()
370 prop = NULL; in check_unit_address_vs_reg()
373 if (prop) { in check_unit_address_vs_reg()
386 struct property *prop; in check_property_name_chars() local
388 for_each_property(node, prop) { in check_property_name_chars()
389 size_t n = strspn(prop->name, c->data); in check_property_name_chars()
391 if (n < strlen(prop->name)) in check_property_name_chars()
392 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
393 prop->name[n]); in check_property_name_chars()
402 struct property *prop; in check_property_name_chars_strict() local
404 for_each_property(node, prop) { in check_property_name_chars_strict()
405 const char *name = prop->name; in check_property_name_chars_strict()
408 if (n == strlen(prop->name)) in check_property_name_chars_strict()
424 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
431 #define DESCLABEL_ARGS(node,prop,mark) \ argument
433 ((prop) ? "'" : ""), \
434 ((prop) ? (prop)->name : ""), \
435 ((prop) ? "' in " : ""), (node)->fullpath
439 struct property *prop, struct marker *mark) in check_duplicate_label() argument
457 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
460 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
468 struct property *prop; in check_duplicate_label_node() local
473 for_each_property(node, prop) { in check_duplicate_label_node()
474 struct marker *m = prop->val.markers; in check_duplicate_label_node()
476 for_each_label(prop->labels, l) in check_duplicate_label_node()
477 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
480 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
489 struct property *prop; in check_phandle_prop() local
493 prop = get_property(node, propname); in check_phandle_prop()
494 if (!prop) in check_phandle_prop()
497 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
498 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
499 prop->val.len, prop->name); in check_phandle_prop()
503 m = prop->val.markers; in check_phandle_prop()
511 prop->name); in check_phandle_prop()
521 phandle = propval_cell(prop); in check_phandle_prop()
524 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
525 phandle, prop->name); in check_phandle_prop()
571 struct property **pp, *prop = NULL; in check_name_properties() local
575 prop = *pp; in check_name_properties()
579 if (!prop) in check_name_properties()
582 if ((prop->val.len != node->basenamelen + 1U) in check_name_properties()
583 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
585 " of base node name)", prop->val.val); in check_name_properties()
589 *pp = prop->next; in check_name_properties()
590 free(prop->name); in check_name_properties()
591 data_free(prop->val); in check_name_properties()
592 free(prop); in check_name_properties()
606 struct property *prop; in fixup_phandle_references() local
608 for_each_property(node, prop) { in fixup_phandle_references()
609 struct marker *m = prop->val.markers; in fixup_phandle_references()
614 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
622 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
628 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
641 struct property *prop; in fixup_path_references() local
643 for_each_property(node, prop) { in fixup_path_references()
644 struct marker *m = prop->val.markers; in fixup_path_references()
649 assert(m->offset <= prop->val.len); in fixup_path_references()
659 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
694 struct property *prop; in check_names_is_string_list() local
696 for_each_property(node, prop) { in check_names_is_string_list()
697 if (!strends(prop->name, "-names")) in check_names_is_string_list()
700 c->data = prop->name; in check_names_is_string_list()
709 struct property *prop; in check_alias_paths() local
714 for_each_property(node, prop) { in check_alias_paths()
715 if (streq(prop->name, "phandle") in check_alias_paths()
716 || streq(prop->name, "linux,phandle")) { in check_alias_paths()
720 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
721 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
722 prop->val.val); in check_alias_paths()
725 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
734 struct property *prop; in fixup_addr_size_cells() local
739 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
740 if (prop) in fixup_addr_size_cells()
741 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
743 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
744 if (prop) in fixup_addr_size_cells()
745 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
758 struct property *prop; in check_reg_format() local
761 prop = get_property(node, "reg"); in check_reg_format()
762 if (!prop) in check_reg_format()
770 if (prop->val.len == 0) in check_reg_format()
771 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
777 if (!is_multiple_of(prop->val.len, entrylen)) in check_reg_format()
778 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
780 prop->val.len, addr_cells, size_cells); in check_reg_format()
787 struct property *prop; in check_ranges_format() local
791 prop = get_property(node, ranges); in check_ranges_format()
792 if (!prop) in check_ranges_format()
796 FAIL_PROP(c, dti, node, prop, "Root node has a \"%s\" property", in check_ranges_format()
807 if (prop->val.len == 0) { in check_ranges_format()
809 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
814 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
818 } else if (!is_multiple_of(prop->val.len, entrylen)) { in check_ranges_format()
819 FAIL_PROP(c, dti, node, prop, "\"%s\" property has invalid length (%d bytes) " in check_ranges_format()
821 "#size-cells == %d)", ranges, prop->val.len, in check_ranges_format()
834 struct property *prop; in check_pci_bridge() local
837 prop = get_property(node, "device_type"); in check_pci_bridge()
838 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
847 prop = get_property(node, "ranges"); in check_pci_bridge()
848 if (!prop) in check_pci_bridge()
856 prop = get_property(node, "bus-range"); in check_pci_bridge()
857 if (!prop) in check_pci_bridge()
860 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
861 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
864 cells = (cell_t *)prop->val.val; in check_pci_bridge()
866 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
868 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
875 struct property *prop; in check_pci_device_bus_num() local
882 prop = get_property(node, "reg"); in check_pci_device_bus_num()
883 if (!prop) in check_pci_device_bus_num()
886 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
889 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
890 if (!prop) { in check_pci_device_bus_num()
893 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
898 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
905 struct property *prop; in check_pci_device_reg() local
914 prop = get_property(node, "reg"); in check_pci_device_reg()
915 if (!prop) in check_pci_device_reg()
918 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
920 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
927 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
929 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
952 struct property *prop; in node_is_compatible() local
955 prop = get_property(node, "compatible"); in node_is_compatible()
956 if (!prop) in node_is_compatible()
959 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
977 struct property *prop; in check_simple_bus_reg() local
987 prop = get_property(node, "reg"); in check_simple_bus_reg()
988 if (prop) in check_simple_bus_reg()
989 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
991 prop = get_property(node, "ranges"); in check_simple_bus_reg()
992 if (prop && prop->val.len) in check_simple_bus_reg()
994 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1049 struct property *prop; in check_i2c_bus_reg() local
1059 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1060 if (prop) in check_i2c_bus_reg()
1061 cells = (cell_t *)prop->val.val; in check_i2c_bus_reg()
1076 for (len = prop->val.len; len > 0; len -= 4) { in check_i2c_bus_reg()
1082 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1085 …FAIL_PROP(c, dti, node, prop, "I2C address must be less than 7-bits, got \"0x%x\". Set I2C_TEN_BIT… in check_i2c_bus_reg()
1109 struct property *prop; in check_spi_bus_bridge() local
1110 for_each_property(child, prop) { in check_spi_bus_bridge()
1111 if (strprefixeq(prop->name, 4, "spi-")) { in check_spi_bus_bridge()
1138 struct property *prop; in check_spi_bus_reg() local
1150 prop = get_property(node, "reg"); in check_spi_bus_reg()
1151 if (prop) in check_spi_bus_reg()
1152 cells = (cell_t *)prop->val.val; in check_spi_bus_reg()
1218 struct property *prop; in check_avoid_unnecessary_addr_size() local
1229 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1230 if (prop) in check_avoid_unnecessary_addr_size()
1241 struct property *prop; in node_is_disabled() local
1243 prop = get_property(node, "status"); in node_is_disabled()
1244 if (prop) { in node_is_disabled()
1245 char *str = prop->val.val; in node_is_disabled()
1311 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1321 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1322 if (prop) in check_obsolete_chosen_interrupt_controller()
1323 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1343 struct property *prop; in check_chosen_node_bootargs() local
1348 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1349 if (!prop) in check_chosen_node_bootargs()
1352 c->data = prop->name; in check_chosen_node_bootargs()
1360 struct property *prop; in check_chosen_node_stdout_path() local
1365 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1366 if (!prop) { in check_chosen_node_stdout_path()
1367 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1368 if (!prop) in check_chosen_node_stdout_path()
1370 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1373 c->data = prop->name; in check_chosen_node_stdout_path()
1387 struct property *prop, in check_property_phandle_args() argument
1393 if (!is_multiple_of(prop->val.len, sizeof(cell_t))) { in check_property_phandle_args()
1394 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1396 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1400 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1406 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1421 if (prop->val.markers) { in check_property_phandle_args()
1422 struct marker *m = prop->val.markers; in check_property_phandle_args()
1428 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1435 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1450 prop->name, cell); in check_property_phandle_args()
1455 if ((expected <= cell) || prop->val.len < expected) { in check_property_phandle_args()
1456 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1458 prop->val.len, cellsize); in check_property_phandle_args()
1469 struct property *prop; in check_provider_cells_property() local
1471 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1472 if (!prop) in check_provider_cells_property()
1475 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1499 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1505 if (strends(prop->name, ",nr-gpios")) in prop_is_gpio()
1508 return strends(prop->name, "-gpios") || in prop_is_gpio()
1509 streq(prop->name, "gpios") || in prop_is_gpio()
1510 strends(prop->name, "-gpio") || in prop_is_gpio()
1511 streq(prop->name, "gpio"); in prop_is_gpio()
1518 struct property *prop; in check_gpios_property() local
1524 for_each_property(node, prop) { in check_gpios_property()
1527 if (!prop_is_gpio(prop)) in check_gpios_property()
1530 provider.prop_name = prop->name; in check_gpios_property()
1533 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1543 struct property *prop; in check_deprecated_gpio_property() local
1545 for_each_property(node, prop) { in check_deprecated_gpio_property()
1546 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1549 if (!strends(prop->name, "gpio")) in check_deprecated_gpio_property()
1552 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1561 struct property *prop; in node_is_interrupt_provider() local
1563 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1564 if (prop) in node_is_interrupt_provider()
1567 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1568 if (prop) in node_is_interrupt_provider()
1578 struct property *prop; in check_interrupt_provider() local
1581 prop = get_property(node, "#interrupt-cells"); in check_interrupt_provider()
1582 if (irq_provider && !prop) { in check_interrupt_provider()
1588 if (!irq_provider && prop) { in check_interrupt_provider()
1601 struct property *prop, *irq_map_prop; in check_interrupt_map() local
1616 prop = get_property(node, "interrupt-map-mask"); in check_interrupt_map()
1617 if (prop && (prop->val.len != (cellsize * sizeof(cell_t)))) in check_interrupt_map()
1618 FAIL_PROP(c, dti, node, prop, in check_interrupt_map()
1620 prop->val.len, cellsize * sizeof(cell_t)); in check_interrupt_map()
1686 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1697 while (parent && !prop) { in check_interrupts_property()
1703 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1704 if (prop) { in check_interrupts_property()
1705 phandle = propval_cell(prop); in check_interrupts_property()
1711 FAIL_PROP(c, dti, parent, prop, "Invalid phandle"); in check_interrupts_property()
1717 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1735 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1736 if (!prop) { in check_interrupts_property()
1741 irq_cells = propval_cell(prop); in check_interrupts_property()
1743 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1791 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1794 if (prop && propval_cell(prop) != 0) in check_graph_child_address()
1811 struct property *prop; in check_graph_reg() local
1813 prop = get_property(node, "reg"); in check_graph_reg()
1814 if (!prop || !unitname) in check_graph_reg()
1817 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1822 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1855 struct property *prop; in get_remote_endpoint() local
1857 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1858 if (!prop) in get_remote_endpoint()
1861 phandle = propval_cell(prop); in get_remote_endpoint()
1868 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()