mirror of https://github.com/torvalds/linux.git
of: Introduce and apply private is_pseudo_property()
There are several places which check if a property name is one of 'name'|'phandle'|'linux,phandle'. Introduce and apply private is_pseudo_property() for the check. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20250224-of_bugfix-v1-2-03640ae8c3a6@quicinc.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
parent
56d733bb8f
commit
f443029c9a
|
|
@ -1855,9 +1855,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
|
||||||
int id, len;
|
int id, len;
|
||||||
|
|
||||||
/* Skip those we do not want to proceed */
|
/* Skip those we do not want to proceed */
|
||||||
if (!of_prop_cmp(pp->name, "name") ||
|
if (is_pseudo_property(pp->name))
|
||||||
!of_prop_cmp(pp->name, "phandle") ||
|
|
||||||
!of_prop_cmp(pp->name, "linux,phandle"))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
np = of_find_node_by_path(pp->value);
|
np = of_find_node_by_path(pp->value);
|
||||||
|
|
|
||||||
|
|
@ -208,4 +208,11 @@ static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int n
|
||||||
static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na) { }
|
static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline bool is_pseudo_property(const char *prop_name)
|
||||||
|
{
|
||||||
|
return !of_prop_cmp(prop_name, "name") ||
|
||||||
|
!of_prop_cmp(prop_name, "phandle") ||
|
||||||
|
!of_prop_cmp(prop_name, "linux,phandle");
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _LINUX_OF_PRIVATE_H */
|
#endif /* _LINUX_OF_PRIVATE_H */
|
||||||
|
|
|
||||||
|
|
@ -304,9 +304,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (target->in_livetree)
|
if (target->in_livetree)
|
||||||
if (!of_prop_cmp(overlay_prop->name, "name") ||
|
if (is_pseudo_property(overlay_prop->name))
|
||||||
!of_prop_cmp(overlay_prop->name, "phandle") ||
|
|
||||||
!of_prop_cmp(overlay_prop->name, "linux,phandle"))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (target->in_livetree)
|
if (target->in_livetree)
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,7 @@ static int adjust_local_phandle_references(const struct device_node *local_fixup
|
||||||
for_each_property_of_node(local_fixups, prop_fix) {
|
for_each_property_of_node(local_fixups, prop_fix) {
|
||||||
|
|
||||||
/* skip properties added automatically */
|
/* skip properties added automatically */
|
||||||
if (!of_prop_cmp(prop_fix->name, "name") ||
|
if (is_pseudo_property(prop_fix->name))
|
||||||
!of_prop_cmp(prop_fix->name, "phandle") ||
|
|
||||||
!of_prop_cmp(prop_fix->name, "linux,phandle"))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((prop_fix->length % 4) != 0 || prop_fix->length == 0)
|
if ((prop_fix->length % 4) != 0 || prop_fix->length == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue