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()
127 #define FAIL_PROP(c, dti, node, prop, ...) \ argument
131 check_msg((c), dti, node, prop, __VA_ARGS__); \
210 struct property *prop; in check_is_string() local
213 prop = get_property(node, propname); in check_is_string()
214 if (!prop) in check_is_string()
217 if (!data_is_one_string(prop->val)) in check_is_string()
218 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
229 struct property *prop; in check_is_string_list() local
233 prop = get_property(node, propname); in check_is_string_list()
234 if (!prop) in check_is_string_list()
237 str = prop->val.val; in check_is_string_list()
238 rem = prop->val.len; in check_is_string_list()
242 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
257 struct property *prop; in check_is_cell() local
260 prop = get_property(node, propname); in check_is_cell()
261 if (!prop) in check_is_cell()
264 if (prop->val.len != sizeof(cell_t)) in check_is_cell()
265 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
293 struct property *prop, *prop2; in check_duplicate_property_names() local
295 for_each_property(node, prop) { in check_duplicate_property_names()
296 for (prop2 = prop->next; prop2; prop2 = prop2->next) { in check_duplicate_property_names()
299 if (streq(prop->name, prop2->name)) in check_duplicate_property_names()
300 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
361 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg() local
368 if (!prop) { in check_unit_address_vs_reg()
369 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
370 if (prop && !prop->val.len) in check_unit_address_vs_reg()
371 prop = NULL; in check_unit_address_vs_reg()
374 if (prop) { in check_unit_address_vs_reg()
387 struct property *prop; in check_property_name_chars() local
389 for_each_property(node, prop) { in check_property_name_chars()
390 size_t n = strspn(prop->name, c->data); in check_property_name_chars()
392 if (n < strlen(prop->name)) in check_property_name_chars()
393 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
394 prop->name[n]); in check_property_name_chars()
403 struct property *prop; in check_property_name_chars_strict() local
405 for_each_property(node, prop) { in check_property_name_chars_strict()
406 const char *name = prop->name; in check_property_name_chars_strict()
409 if (n == strlen(prop->name)) in check_property_name_chars_strict()
425 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
432 #define DESCLABEL_ARGS(node,prop,mark) \ argument
434 ((prop) ? "'" : ""), \
435 ((prop) ? (prop)->name : ""), \
436 ((prop) ? "' in " : ""), (node)->fullpath
440 struct property *prop, struct marker *mark) in check_duplicate_label() argument
458 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
461 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
469 struct property *prop; in check_duplicate_label_node() local
474 for_each_property(node, prop) { in check_duplicate_label_node()
475 struct marker *m = prop->val.markers; in check_duplicate_label_node()
477 for_each_label(prop->labels, l) in check_duplicate_label_node()
478 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
481 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
490 struct property *prop; in check_phandle_prop() local
494 prop = get_property(node, propname); in check_phandle_prop()
495 if (!prop) in check_phandle_prop()
498 if (prop->val.len != sizeof(cell_t)) { in check_phandle_prop()
499 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
500 prop->val.len, prop->name); in check_phandle_prop()
504 m = prop->val.markers; in check_phandle_prop()
512 prop->name); in check_phandle_prop()
522 phandle = propval_cell(prop); in check_phandle_prop()
525 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
526 phandle, prop->name); in check_phandle_prop()
572 struct property **pp, *prop = NULL; in check_name_properties() local
576 prop = *pp; in check_name_properties()
580 if (!prop) in check_name_properties()
583 if ((prop->val.len != node->basenamelen + 1U) in check_name_properties()
584 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
586 " of base node name)", prop->val.val); in check_name_properties()
590 *pp = prop->next; in check_name_properties()
591 free(prop->name); in check_name_properties()
592 data_free(prop->val); in check_name_properties()
593 free(prop); in check_name_properties()
607 struct property *prop; in fixup_phandle_references() local
609 for_each_property(node, prop) { in fixup_phandle_references()
610 struct marker *m = prop->val.markers; in fixup_phandle_references()
615 assert(m->offset + sizeof(cell_t) <= prop->val.len); in fixup_phandle_references()
623 *((fdt32_t *)(prop->val.val + m->offset)) = in fixup_phandle_references()
629 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); in fixup_phandle_references()
642 struct property *prop; in fixup_path_references() local
644 for_each_property(node, prop) { in fixup_path_references()
645 struct marker *m = prop->val.markers; in fixup_path_references()
650 assert(m->offset <= prop->val.len); in fixup_path_references()
660 prop->val = data_insert_at_marker(prop->val, m, path, in fixup_path_references()
695 struct property *prop; in check_names_is_string_list() local
697 for_each_property(node, prop) { in check_names_is_string_list()
698 if (!strends(prop->name, "-names")) in check_names_is_string_list()
701 c->data = prop->name; in check_names_is_string_list()
710 struct property *prop; in check_alias_paths() local
715 for_each_property(node, prop) { in check_alias_paths()
716 if (streq(prop->name, "phandle") in check_alias_paths()
717 || streq(prop->name, "linux,phandle")) { in check_alias_paths()
721 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
722 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
723 prop->val.val); in check_alias_paths()
726 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
735 struct property *prop; in fixup_addr_size_cells() local
740 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
741 if (prop) in fixup_addr_size_cells()
742 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
744 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
745 if (prop) in fixup_addr_size_cells()
746 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
759 struct property *prop; in check_reg_format() local
762 prop = get_property(node, "reg"); in check_reg_format()
763 if (!prop) in check_reg_format()
771 if (prop->val.len == 0) in check_reg_format()
772 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
778 if (!is_multiple_of(prop->val.len, entrylen)) in check_reg_format()
779 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
781 prop->val.len, addr_cells, size_cells); in check_reg_format()
788 struct property *prop; in check_ranges_format() local
792 prop = get_property(node, ranges); in check_ranges_format()
793 if (!prop) in check_ranges_format()
797 FAIL_PROP(c, dti, node, prop, "Root node has a \"%s\" property", in check_ranges_format()
808 if (prop->val.len == 0) { in check_ranges_format()
810 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
815 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
819 } else if (!is_multiple_of(prop->val.len, entrylen)) { in check_ranges_format()
820 FAIL_PROP(c, dti, node, prop, "\"%s\" property has invalid length (%d bytes) " in check_ranges_format()
822 "#size-cells == %d)", ranges, prop->val.len, in check_ranges_format()
835 struct property *prop; in check_pci_bridge() local
838 prop = get_property(node, "device_type"); in check_pci_bridge()
839 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
848 prop = get_property(node, "ranges"); in check_pci_bridge()
849 if (!prop) in check_pci_bridge()
857 prop = get_property(node, "bus-range"); in check_pci_bridge()
858 if (!prop) in check_pci_bridge()
861 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
862 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
865 cells = (cell_t *)prop->val.val; in check_pci_bridge()
867 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
869 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
876 struct property *prop; in check_pci_device_bus_num() local
883 prop = get_property(node, "reg"); in check_pci_device_bus_num()
884 if (!prop) in check_pci_device_bus_num()
887 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
890 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
891 if (!prop) { in check_pci_device_bus_num()
894 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
899 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
906 struct property *prop; in check_pci_device_reg() local
915 prop = get_property(node, "reg"); in check_pci_device_reg()
916 if (!prop) in check_pci_device_reg()
919 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
921 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
928 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
930 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
953 struct property *prop; in node_is_compatible() local
956 prop = get_property(node, "compatible"); in node_is_compatible()
957 if (!prop) in node_is_compatible()
960 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
978 struct property *prop; in check_simple_bus_reg() local
988 prop = get_property(node, "reg"); in check_simple_bus_reg()
989 if (prop) in check_simple_bus_reg()
990 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
992 prop = get_property(node, "ranges"); in check_simple_bus_reg()
993 if (prop && prop->val.len) in check_simple_bus_reg()
995 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1050 struct property *prop; in check_i2c_bus_reg() local
1060 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1061 if (prop) in check_i2c_bus_reg()
1062 cells = (cell_t *)prop->val.val; in check_i2c_bus_reg()
1077 for (len = prop->val.len; len > 0; len -= 4) { in check_i2c_bus_reg()
1084 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1087 …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()
1111 struct property *prop; in check_spi_bus_bridge() local
1112 for_each_property(child, prop) { in check_spi_bus_bridge()
1113 if (strstarts(prop->name, "spi-")) { in check_spi_bus_bridge()
1140 struct property *prop; in check_spi_bus_reg() local
1152 prop = get_property(node, "reg"); in check_spi_bus_reg()
1153 if (prop) in check_spi_bus_reg()
1154 cells = (cell_t *)prop->val.val; in check_spi_bus_reg()
1220 struct property *prop; in check_avoid_unnecessary_addr_size() local
1231 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1232 if (prop) in check_avoid_unnecessary_addr_size()
1243 struct property *prop; in node_is_disabled() local
1245 prop = get_property(node, "status"); in node_is_disabled()
1246 if (prop) { in node_is_disabled()
1247 char *str = prop->val.val; in node_is_disabled()
1313 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1323 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1324 if (prop) in check_obsolete_chosen_interrupt_controller()
1325 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1345 struct property *prop; in check_chosen_node_bootargs() local
1350 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1351 if (!prop) in check_chosen_node_bootargs()
1354 c->data = prop->name; in check_chosen_node_bootargs()
1362 struct property *prop; in check_chosen_node_stdout_path() local
1367 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1368 if (!prop) { in check_chosen_node_stdout_path()
1369 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1370 if (!prop) in check_chosen_node_stdout_path()
1372 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1375 c->data = prop->name; in check_chosen_node_stdout_path()
1389 struct property *prop, in check_property_phandle_args() argument
1395 if (!is_multiple_of(prop->val.len, sizeof(cell_t))) { in check_property_phandle_args()
1396 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1398 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1402 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1408 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1423 if (prop->val.markers) { in check_property_phandle_args()
1424 struct marker *m = prop->val.markers; in check_property_phandle_args()
1430 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1437 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1452 prop->name, cell); in check_property_phandle_args()
1457 if ((expected <= cell) || prop->val.len < expected) { in check_property_phandle_args()
1458 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1460 prop->val.len, cellsize); in check_property_phandle_args()
1471 struct property *prop; in check_provider_cells_property() local
1473 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1474 if (!prop) in check_provider_cells_property()
1477 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1501 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1507 if (strends(prop->name, ",nr-gpios")) in prop_is_gpio()
1510 return strends(prop->name, "-gpios") || in prop_is_gpio()
1511 streq(prop->name, "gpios") || in prop_is_gpio()
1512 strends(prop->name, "-gpio") || in prop_is_gpio()
1513 streq(prop->name, "gpio"); in prop_is_gpio()
1520 struct property *prop; in check_gpios_property() local
1526 for_each_property(node, prop) { in check_gpios_property()
1529 if (!prop_is_gpio(prop)) in check_gpios_property()
1532 provider.prop_name = prop->name; in check_gpios_property()
1535 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1545 struct property *prop; in check_deprecated_gpio_property() local
1547 for_each_property(node, prop) { in check_deprecated_gpio_property()
1548 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1551 if (!strends(prop->name, "gpio")) in check_deprecated_gpio_property()
1554 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1563 struct property *prop; in node_is_interrupt_provider() local
1565 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1566 if (prop) in node_is_interrupt_provider()
1569 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1570 if (prop) in node_is_interrupt_provider()
1580 struct property *prop; in check_interrupt_provider() local
1583 prop = get_property(node, "#interrupt-cells"); in check_interrupt_provider()
1584 if (irq_provider && !prop) { in check_interrupt_provider()
1590 if (!irq_provider && prop) { in check_interrupt_provider()
1603 struct property *prop, *irq_map_prop; in check_interrupt_map() local
1618 prop = get_property(node, "interrupt-map-mask"); in check_interrupt_map()
1619 if (prop && (prop->val.len != (cellsize * sizeof(cell_t)))) in check_interrupt_map()
1620 FAIL_PROP(c, dti, node, prop, in check_interrupt_map()
1622 prop->val.len, cellsize * sizeof(cell_t)); in check_interrupt_map()
1692 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1703 while (parent && !prop) { in check_interrupts_property()
1709 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1710 if (prop) { in check_interrupts_property()
1711 phandle = propval_cell(prop); in check_interrupts_property()
1717 FAIL_PROP(c, dti, parent, prop, "Invalid phandle"); in check_interrupts_property()
1723 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1741 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1742 if (!prop) { in check_interrupts_property()
1747 irq_cells = propval_cell(prop); in check_interrupts_property()
1749 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1797 struct property *prop; in check_graph_reg() local
1799 prop = get_property(node, "reg"); in check_graph_reg()
1800 if (!prop || !unitname) in check_graph_reg()
1803 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1808 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1845 struct property *prop; in get_remote_endpoint() local
1847 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1848 if (!prop) in get_remote_endpoint()
1851 phandle = propval_cell(prop); in get_remote_endpoint()
1858 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()
1900 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1903 if (prop && propval_cell(prop) != 0 ) in check_graph_child_address()