diff options
-rw-r--r-- | drivers/of/base.c | 4 | ||||
-rw-r--r-- | drivers/of/of_private.h | 7 | ||||
-rw-r--r-- | drivers/of/overlay.c | 4 | ||||
-rw-r--r-- | drivers/of/resolver.c | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index d2d41601136b..001ff6ce4abf 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1855,9 +1855,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) int id, len; /* Skip those we do not want to proceed */ - if (!of_prop_cmp(pp->name, "name") || - !of_prop_cmp(pp->name, "phandle") || - !of_prop_cmp(pp->name, "linux,phandle")) + if (is_pseudo_property(pp->name)) continue; np = of_find_node_by_path(pp->value); diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index f3e1193c8ded..b0c077867bf4 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -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) { } #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 */ diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 434f6dd6a86c..5a51c52b9729 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -304,9 +304,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs, int ret = 0; if (target->in_livetree) - if (!of_prop_cmp(overlay_prop->name, "name") || - !of_prop_cmp(overlay_prop->name, "phandle") || - !of_prop_cmp(overlay_prop->name, "linux,phandle")) + if (is_pseudo_property(overlay_prop->name)) return 0; if (target->in_livetree) diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 2caad365a665..86424e145919 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -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) { /* skip properties added automatically */ - if (!of_prop_cmp(prop_fix->name, "name") || - !of_prop_cmp(prop_fix->name, "phandle") || - !of_prop_cmp(prop_fix->name, "linux,phandle")) + if (is_pseudo_property(prop_fix->name)) continue; if ((prop_fix->length % 4) != 0 || prop_fix->length == 0) |