Lines Matching +full:prop +full:-
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2012 Pantelis Antoniou <panto@antoniou-consulting.com>
32 if (node->phandle != OF_PHANDLE_ILLEGAL && in live_tree_max_phandle()
33 node->phandle > phandle) in live_tree_max_phandle()
34 phandle = node->phandle; in live_tree_max_phandle()
45 const struct property *prop; in adjust_overlay_phandles() local
49 if (overlay->phandle != 0 && overlay->phandle != OF_PHANDLE_ILLEGAL) in adjust_overlay_phandles()
50 overlay->phandle += phandle_delta; in adjust_overlay_phandles()
53 for_each_property_of_node(overlay, prop) { in adjust_overlay_phandles()
55 if (of_prop_cmp(prop->name, "phandle") && in adjust_overlay_phandles()
56 of_prop_cmp(prop->name, "linux,phandle")) in adjust_overlay_phandles()
59 if (prop->length < 4) in adjust_overlay_phandles()
62 phandle = be32_to_cpup(prop->value); in adjust_overlay_phandles()
66 *(__be32 *)prop->value = cpu_to_be32(overlay->phandle); in adjust_overlay_phandles()
77 const struct property *prop; in update_usages_of_a_phandle_reference() local
78 char *value __free(kfree) = kmemdup(prop_fixup->value, prop_fixup->length, GFP_KERNEL); in update_usages_of_a_phandle_reference()
84 return -ENOMEM; in update_usages_of_a_phandle_reference()
87 end = value + prop_fixup->length; in update_usages_of_a_phandle_reference()
94 return -EINVAL; in update_usages_of_a_phandle_reference()
100 return -EINVAL; in update_usages_of_a_phandle_reference()
111 for_each_property_of_node(refnode, prop) { in update_usages_of_a_phandle_reference()
112 if (!of_prop_cmp(prop->name, prop_name)) in update_usages_of_a_phandle_reference()
117 if (!prop) in update_usages_of_a_phandle_reference()
118 return -ENOENT; in update_usages_of_a_phandle_reference()
120 if (offset < 0 || offset + sizeof(__be32) > prop->length) in update_usages_of_a_phandle_reference()
121 return -EINVAL; in update_usages_of_a_phandle_reference()
123 *(__be32 *)(prop->value + offset) = cpu_to_be32(phandle); in update_usages_of_a_phandle_reference()
133 const char *n1 = kbasename(dn1->full_name); in node_name_cmp()
134 const char *n2 = kbasename(dn2->full_name); in node_name_cmp()
154 const struct property *prop_fix, *prop; in adjust_local_phandle_references() local
164 if (!of_prop_cmp(prop_fix->name, "name") || in adjust_local_phandle_references()
165 !of_prop_cmp(prop_fix->name, "phandle") || in adjust_local_phandle_references()
166 !of_prop_cmp(prop_fix->name, "linux,phandle")) in adjust_local_phandle_references()
169 if ((prop_fix->length % 4) != 0 || prop_fix->length == 0) in adjust_local_phandle_references()
170 return -EINVAL; in adjust_local_phandle_references()
171 count = prop_fix->length / sizeof(__be32); in adjust_local_phandle_references()
173 for_each_property_of_node(overlay, prop) { in adjust_local_phandle_references()
174 if (!of_prop_cmp(prop->name, prop_fix->name)) in adjust_local_phandle_references()
178 if (!prop) in adjust_local_phandle_references()
179 return -EINVAL; in adjust_local_phandle_references()
182 off = be32_to_cpu(((__be32 *)prop_fix->value)[i]); in adjust_local_phandle_references()
183 if ((off + 4) > prop->length) in adjust_local_phandle_references()
184 return -EINVAL; in adjust_local_phandle_references()
186 be32_add_cpu(prop->value + off, phandle_delta); in adjust_local_phandle_references()
206 return -EINVAL; in adjust_local_phandle_references()
218 * of_resolve_phandles - Relocate and resolve overlay against live tree
254 struct property *prop; in of_resolve_phandles() local
263 err = -EINVAL; in of_resolve_phandles()
269 err = -EINVAL; in of_resolve_phandles()
299 err = -EINVAL; in of_resolve_phandles()
303 for_each_property_of_node(overlay_fixups, prop) { in of_resolve_phandles()
306 if (!of_prop_cmp(prop->name, "name")) in of_resolve_phandles()
310 prop->name, &refpath); in of_resolve_phandles()
313 prop->name); in of_resolve_phandles()
319 err = -ENOENT; in of_resolve_phandles()
323 phandle = refnode->phandle; in of_resolve_phandles()
326 err = update_usages_of_a_phandle_reference(overlay, prop, phandle); in of_resolve_phandles()