• Home
  • Raw
  • Download

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 (streq(prop->name, "phandle") in check_alias_paths()
695 || streq(prop->name, "linux,phandle")) { in check_alias_paths()
699 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
700 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
701 prop->val.val); in check_alias_paths()
704 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) in check_alias_paths()
713 struct property *prop; in fixup_addr_size_cells() local
718 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
719 if (prop) in fixup_addr_size_cells()
720 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
722 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
723 if (prop) in fixup_addr_size_cells()
724 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
737 struct property *prop; in check_reg_format() local
740 prop = get_property(node, "reg"); in check_reg_format()
741 if (!prop) in check_reg_format()
749 if (prop->val.len == 0) in check_reg_format()
750 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
756 if (!entrylen || (prop->val.len % entrylen) != 0) in check_reg_format()
757 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
759 prop->val.len, addr_cells, size_cells); in check_reg_format()
766 struct property *prop; in check_ranges_format() local
770 prop = get_property(node, ranges); in check_ranges_format()
771 if (!prop) in check_ranges_format()
775 FAIL_PROP(c, dti, node, prop, "Root node has a \"%s\" property", in check_ranges_format()
786 if (prop->val.len == 0) { in check_ranges_format()
788 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
793 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
797 } else if ((prop->val.len % entrylen) != 0) { in check_ranges_format()
798 FAIL_PROP(c, dti, node, prop, "\"%s\" property has invalid length (%d bytes) " in check_ranges_format()
800 "#size-cells == %d)", ranges, prop->val.len, in check_ranges_format()
813 struct property *prop; in check_pci_bridge() local
816 prop = get_property(node, "device_type"); in check_pci_bridge()
817 if (!prop || !streq(prop->val.val, "pci")) in check_pci_bridge()
826 prop = get_property(node, "ranges"); in check_pci_bridge()
827 if (!prop) in check_pci_bridge()
835 prop = get_property(node, "bus-range"); in check_pci_bridge()
836 if (!prop) in check_pci_bridge()
839 if (prop->val.len != (sizeof(cell_t) * 2)) { in check_pci_bridge()
840 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
843 cells = (cell_t *)prop->val.val; in check_pci_bridge()
845 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
847 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
854 struct property *prop; in check_pci_device_bus_num() local
861 prop = get_property(node, "reg"); in check_pci_device_bus_num()
862 if (!prop) in check_pci_device_bus_num()
865 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
868 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
869 if (!prop) { in check_pci_device_bus_num()
872 cells = (cell_t *)prop->val.val; in check_pci_device_bus_num()
877 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
884 struct property *prop; in check_pci_device_reg() local
893 prop = get_property(node, "reg"); in check_pci_device_reg()
894 if (!prop) in check_pci_device_reg()
897 cells = (cell_t *)prop->val.val; in check_pci_device_reg()
899 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
906 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
908 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
931 struct property *prop; in node_is_compatible() local
934 prop = get_property(node, "compatible"); in node_is_compatible()
935 if (!prop) in node_is_compatible()
938 for (str = prop->val.val, end = str + prop->val.len; str < end; in node_is_compatible()
956 struct property *prop; in check_simple_bus_reg() local
966 prop = get_property(node, "reg"); in check_simple_bus_reg()
967 if (prop) in check_simple_bus_reg()
968 cells = (cell_t *)prop->val.val; in check_simple_bus_reg()
970 prop = get_property(node, "ranges"); in check_simple_bus_reg()
971 if (prop && prop->val.len) in check_simple_bus_reg()
973 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
1028 struct property *prop; in check_i2c_bus_reg() local
1038 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1039 if (prop) in check_i2c_bus_reg()
1040 cells = (cell_t *)prop->val.val; in check_i2c_bus_reg()
1055 for (len = prop->val.len; len > 0; len -= 4) { in check_i2c_bus_reg()
1061 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1064 …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()
1088 struct property *prop; in check_spi_bus_bridge() local
1089 for_each_property(child, prop) { in check_spi_bus_bridge()
1090 if (strprefixeq(prop->name, 4, "spi-")) { in check_spi_bus_bridge()
1117 struct property *prop; in check_spi_bus_reg() local
1129 prop = get_property(node, "reg"); in check_spi_bus_reg()
1130 if (prop) in check_spi_bus_reg()
1131 cells = (cell_t *)prop->val.val; in check_spi_bus_reg()
1197 struct property *prop; in check_avoid_unnecessary_addr_size() local
1208 prop = get_property(child, "reg"); in check_avoid_unnecessary_addr_size()
1209 if (prop) in check_avoid_unnecessary_addr_size()
1220 struct property *prop; in node_is_disabled() local
1222 prop = get_property(node, "status"); in node_is_disabled()
1223 if (prop) { in node_is_disabled()
1224 char *str = prop->val.val; in node_is_disabled()
1290 struct property *prop; in check_obsolete_chosen_interrupt_controller() local
1300 prop = get_property(chosen, "interrupt-controller"); in check_obsolete_chosen_interrupt_controller()
1301 if (prop) in check_obsolete_chosen_interrupt_controller()
1302 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1322 struct property *prop; in check_chosen_node_bootargs() local
1327 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1328 if (!prop) in check_chosen_node_bootargs()
1331 c->data = prop->name; in check_chosen_node_bootargs()
1339 struct property *prop; in check_chosen_node_stdout_path() local
1344 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1345 if (!prop) { in check_chosen_node_stdout_path()
1346 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1347 if (!prop) in check_chosen_node_stdout_path()
1349 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1352 c->data = prop->name; in check_chosen_node_stdout_path()
1366 struct property *prop, in check_property_phandle_args() argument
1372 if (prop->val.len % sizeof(cell_t)) { in check_property_phandle_args()
1373 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1375 prop->val.len, sizeof(cell_t)); in check_property_phandle_args()
1379 for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { in check_property_phandle_args()
1384 phandle = propval_cell_n(prop, cell); in check_property_phandle_args()
1399 if (prop->val.markers) { in check_property_phandle_args()
1400 struct marker *m = prop->val.markers; in check_property_phandle_args()
1406 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1413 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1428 prop->name, cell); in check_property_phandle_args()
1432 if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { in check_property_phandle_args()
1433 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1435 prop->val.len, cellsize); in check_property_phandle_args()
1445 struct property *prop; in check_provider_cells_property() local
1447 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1448 if (!prop) in check_provider_cells_property()
1451 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1474 static bool prop_is_gpio(struct property *prop) in prop_is_gpio() argument
1482 if (strstr(prop->name, "nr-gpio")) in prop_is_gpio()
1485 str = strrchr(prop->name, '-'); in prop_is_gpio()
1489 str = prop->name; in prop_is_gpio()
1500 struct property *prop; in check_gpios_property() local
1506 for_each_property(node, prop) { in check_gpios_property()
1509 if (!prop_is_gpio(prop)) in check_gpios_property()
1512 provider.prop_name = prop->name; in check_gpios_property()
1515 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1525 struct property *prop; in check_deprecated_gpio_property() local
1527 for_each_property(node, prop) { in check_deprecated_gpio_property()
1530 if (!prop_is_gpio(prop)) in check_deprecated_gpio_property()
1533 str = strstr(prop->name, "gpio"); in check_deprecated_gpio_property()
1537 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1546 struct property *prop; in node_is_interrupt_provider() local
1548 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1549 if (prop) in node_is_interrupt_provider()
1552 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1553 if (prop) in node_is_interrupt_provider()
1563 struct property *prop; in check_interrupt_provider() local
1568 prop = get_property(node, "#interrupt-cells"); in check_interrupt_provider()
1569 if (!prop) in check_interrupt_provider()
1573 prop = get_property(node, "#address-cells"); in check_interrupt_provider()
1574 if (!prop) in check_interrupt_provider()
1586 struct property *irq_prop, *prop = NULL; in check_interrupts_property() local
1597 while (parent && !prop) { in check_interrupts_property()
1603 prop = get_property(parent, "interrupt-parent"); in check_interrupts_property()
1604 if (prop) { in check_interrupts_property()
1605 phandle = propval_cell(prop); in check_interrupts_property()
1611 FAIL_PROP(c, dti, parent, prop, "Invalid phandle"); in check_interrupts_property()
1617 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1635 prop = get_property(irq_node, "#interrupt-cells"); in check_interrupts_property()
1636 if (!prop) { in check_interrupts_property()
1641 irq_cells = propval_cell(prop); in check_interrupts_property()
1643 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1691 struct property *prop = get_property(child, "reg"); in check_graph_child_address() local
1694 if (prop && propval_cell(prop) != 0) in check_graph_child_address()
1711 struct property *prop; in check_graph_reg() local
1713 prop = get_property(node, "reg"); in check_graph_reg()
1714 if (!prop || !unitname) in check_graph_reg()
1717 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { in check_graph_reg()
1722 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); in check_graph_reg()
1755 struct property *prop; in get_remote_endpoint() local
1757 prop = get_property(endpoint, "remote-endpoint"); in get_remote_endpoint()
1758 if (!prop) in get_remote_endpoint()
1761 phandle = propval_cell(prop); in get_remote_endpoint()
1768 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); in get_remote_endpoint()