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()
648 struct property *prop = get_property(node, "status"); in fixup_node_disabled() local
650 if (prop) { in fixup_node_disabled()
651 const char *status = prop->val.val; in fixup_node_disabled()
679 struct property *prop; in fixup_omit_unused_nodes() local
684 for_each_property(parent, prop) in fixup_omit_unused_nodes()
712 struct property *prop; in check_names_is_string_list() local
714 for_each_property(node, prop) { in check_names_is_string_list()
715 const char *s = strrchr(prop->name, '-'); in check_names_is_string_list()
719 c->data = prop->name; in check_names_is_string_list()
728 struct property *prop; in check_alias_paths() local
733 for_each_property(node, prop) { in check_alias_paths()
734 if (streq(prop->name, "phandle") in check_alias_paths()
735 || streq(prop->name, "linux,phandle")) { in check_alias_paths()
739 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
740 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
741 prop->val.val); in check_alias_paths()
744 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
753 struct property *prop; in fixup_addr_size_cells() local
758 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
759 if (prop) in fixup_addr_size_cells()
760 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
762 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
763 if (prop) in fixup_addr_size_cells()
764 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
777 struct property *prop; in check_reg_format() local
780 prop = get_property(node, "reg"); in check_reg_format()
781 if (!prop) in check_reg_format()
789 if (prop->val.len == 0) in check_reg_format()
790 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
796 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
797 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
799 prop->val.len, addr_cells, size_cells); in check_reg_format()
806 struct property *prop; in check_ranges_format() local
810 prop = get_property(node, ranges); in check_ranges_format()
811 if (!prop) in check_ranges_format()
815 FAIL_PROP(c, dti, node, prop, "Root node has a \"%s\" property", in check_ranges_format()
826 if (prop->val.len == 0) { in check_ranges_format()
828 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
833 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
837 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
838 FAIL_PROP(c, dti, node, prop, "\"%s\" property has invalid length (%d bytes) " in check_ranges_format()
840 "#size-cells == %d)", ranges, prop->val.len, in check_ranges_format()
853 struct property *prop; in check_pci_bridge() local
856 prop = get_property(node, "device_type"); in check_pci_bridge()
857 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
866 prop = get_property(node, "ranges"); in check_pci_bridge()
867 if (!prop) in check_pci_bridge()
875 prop = get_property(node, "bus-range"); in check_pci_bridge()
876 if (!prop) in check_pci_bridge()
879 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
880 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
883 cells = (cell_t *)prop->val.val; in check_pci_bridge()
885 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
887 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
894 struct property *prop; in check_pci_device_bus_num() local
901 prop = get_property(node, "reg"); in check_pci_device_bus_num()
902 if (!prop) in check_pci_device_bus_num()
905 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
908 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
909 if (!prop) { in check_pci_device_bus_num()
912 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
917 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
924 struct property *prop; in check_pci_device_reg() local
933 prop = get_property(node, "reg"); in check_pci_device_reg()
934 if (!prop) in check_pci_device_reg()
937 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
939 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
946 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
948 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
971 struct property *prop; in node_is_compatible() local
974 prop = get_property(node, "compatible"); in node_is_compatible()
975 if (!prop) in node_is_compatible()
978 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
996 struct property *prop; in check_simple_bus_reg() local
1006 prop = get_property(node, "reg"); in check_simple_bus_reg()
1007 if (prop) in check_simple_bus_reg()
1008 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
1010 prop = get_property(node, "ranges"); in check_simple_bus_reg()
1011 if (prop && prop->val.len) in check_simple_bus_reg()
1013 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1068 struct property *prop; in check_i2c_bus_reg() local
1078 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1079 if (prop) in check_i2c_bus_reg()
1080 cells = (cell_t *)prop->val.val; in check_i2c_bus_reg()
1095 for (len = prop->val.len; len > 0; len -= 4) { in check_i2c_bus_reg()
1101 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1104 …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()
1128 struct property *prop; in check_spi_bus_bridge() local
1129 for_each_property(child, prop) { in check_spi_bus_bridge()
1130 if (strprefixeq(prop->name, 4, "spi-")) { in check_spi_bus_bridge()
1157 struct property *prop; in check_spi_bus_reg() local
1169 prop = get_property(node, "reg"); in check_spi_bus_reg()
1170 if (prop) in check_spi_bus_reg()
1171 cells = (cell_t *)prop->val.val; in check_spi_bus_reg()
1237 struct property *prop; in check_avoid_unnecessary_addr_size() local
1248 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1249 if (prop) in check_avoid_unnecessary_addr_size()
1260 struct property *prop; in node_is_disabled() local
1262 prop = get_property(node, "status"); in node_is_disabled()
1263 if (prop) { in node_is_disabled()
1264 char *str = prop->val.val; in node_is_disabled()
1330 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1340 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1341 if (prop) in check_obsolete_chosen_interrupt_controller()
1342 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1362 struct property *prop; in check_chosen_node_bootargs() local
1367 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1368 if (!prop) in check_chosen_node_bootargs()
1371 c->data = prop->name; in check_chosen_node_bootargs()
1379 struct property *prop; in check_chosen_node_stdout_path() local
1384 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1385 if (!prop) { in check_chosen_node_stdout_path()
1386 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1387 if (!prop) in check_chosen_node_stdout_path()
1389 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1392 c->data = prop->name; in check_chosen_node_stdout_path()
1406 struct property *prop, in check_property_phandle_args() argument
1412 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1413 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1415 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1419 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1424 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1439 if (prop->val.markers) { in check_property_phandle_args()
1440 struct marker *m = prop->val.markers; in check_property_phandle_args()
1446 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1453 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1468 prop->name, cell); in check_property_phandle_args()
1472 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1473 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1475 prop->val.len, cellsize); in check_property_phandle_args()
1485 struct property *prop; in check_provider_cells_property() local
1487 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1488 if (!prop) in check_provider_cells_property()
1491 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1514 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1522 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1525 str = strrchr(prop->name, '-'); in prop_is_gpio()
1529 str = prop->name; in prop_is_gpio()
1540 struct property *prop; in check_gpios_property() local
1546 for_each_property(node, prop) { in check_gpios_property()
1549 if (!prop_is_gpio(prop)) in check_gpios_property()
1552 provider.prop_name = prop->name; in check_gpios_property()
1555 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1565 struct property *prop; in check_deprecated_gpio_property() local
1567 for_each_property(node, prop) { in check_deprecated_gpio_property()
1570 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1573 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1577 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1586 struct property *prop; in node_is_interrupt_provider() local
1588 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1589 if (prop) in node_is_interrupt_provider()
1592 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1593 if (prop) in node_is_interrupt_provider()
1603 struct property *prop; in check_interrupt_provider() local
1608 prop = get_property(node, "#interrupt-cells"); in check_interrupt_provider()
1609 if (!prop) in check_interrupt_provider()
1613 prop = get_property(node, "#address-cells"); in check_interrupt_provider()
1614 if (!prop) in check_interrupt_provider()
1626 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1637 while (parent && !prop) { in check_interrupts_property()
1643 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1644 if (prop) { in check_interrupts_property()
1645 phandle = propval_cell(prop); in check_interrupts_property()
1651 FAIL_PROP(c, dti, parent, prop, "Invalid phandle"); in check_interrupts_property()
1657 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1675 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1676 if (!prop) { in check_interrupts_property()
1681 irq_cells = propval_cell(prop); in check_interrupts_property()
1683 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1731 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1734 if (prop && propval_cell(prop) != 0) in check_graph_child_address()
1751 struct property *prop; in check_graph_reg() local
1753 prop = get_property(node, "reg"); in check_graph_reg()
1754 if (!prop || !unitname) in check_graph_reg()
1757 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1762 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1795 struct property *prop; in get_remote_endpoint() local
1797 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1798 if (!prop) in get_remote_endpoint()
1801 phandle = propval_cell(prop); in get_remote_endpoint()
1808 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()