* Update all /__symbols__ properties in an overlay that start with * "/fragment@X/__overlay__" with corresponding path prefix in the base tree. * * @param symbols /__symbols__ done to update. * @param fragment /fragment@X node that references to should be updated. * @param base_path Path of base tree node that the fragment overlaid. */
| 1806 | * @param base_path Path of base tree node that the fragment overlaid. |
| 1807 | */ |
| 1808 | static void dt_fix_symbols(struct device_tree_node *symbols, |
| 1809 | struct device_tree_node *fragment, |
| 1810 | const char *base_path) |
| 1811 | { |
| 1812 | struct device_tree_property *prop; |
| 1813 | char buf[512]; /* Should be enough for maximum DT path length? */ |
| 1814 | char node_path[64]; /* easily enough for /fragment@XXXX/__overlay__ */ |
| 1815 | |
| 1816 | if (!symbols) /* If the overlay has no /__symbols__ node, we're done! */ |
| 1817 | return; |
| 1818 | |
| 1819 | int len = snprintf(node_path, sizeof(node_path), "/%s/__overlay__", |
| 1820 | fragment->name); |
| 1821 | |
| 1822 | list_for_each(prop, symbols->properties, list_node) |
| 1823 | if (!strncmp(prop->prop.data, node_path, len)) { |
| 1824 | prop->prop.size = snprintf(buf, sizeof(buf), "%s%s", |
| 1825 | base_path, (char *)prop->prop.data + len) + 1; |
| 1826 | free(prop->prop.data); |
| 1827 | prop->prop.data = strdup(buf); |
| 1828 | } |
| 1829 | } |
| 1830 | |
| 1831 | /* |
| 1832 | * Fix up overlay according to a property in /__fixup__. If the fixed property |
no test coverage detected