Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Zijun Hu and committed by
Rob Herring (Arm)
f443029c 56d733bb

+10 -9
+1 -3
drivers/of/base.c
··· 1855 1855 int id, len; 1856 1856 1857 1857 /* Skip those we do not want to proceed */ 1858 - if (!of_prop_cmp(pp->name, "name") || 1859 - !of_prop_cmp(pp->name, "phandle") || 1860 - !of_prop_cmp(pp->name, "linux,phandle")) 1858 + if (is_pseudo_property(pp->name)) 1861 1859 continue; 1862 1860 1863 1861 np = of_find_node_by_path(pp->value);
+7
drivers/of/of_private.h
··· 208 208 static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na) { } 209 209 #endif 210 210 211 + static inline bool is_pseudo_property(const char *prop_name) 212 + { 213 + return !of_prop_cmp(prop_name, "name") || 214 + !of_prop_cmp(prop_name, "phandle") || 215 + !of_prop_cmp(prop_name, "linux,phandle"); 216 + } 217 + 211 218 #endif /* _LINUX_OF_PRIVATE_H */
+1 -3
drivers/of/overlay.c
··· 304 304 int ret = 0; 305 305 306 306 if (target->in_livetree) 307 - if (!of_prop_cmp(overlay_prop->name, "name") || 308 - !of_prop_cmp(overlay_prop->name, "phandle") || 309 - !of_prop_cmp(overlay_prop->name, "linux,phandle")) 307 + if (is_pseudo_property(overlay_prop->name)) 310 308 return 0; 311 309 312 310 if (target->in_livetree)
+1 -3
drivers/of/resolver.c
··· 161 161 for_each_property_of_node(local_fixups, prop_fix) { 162 162 163 163 /* skip properties added automatically */ 164 - if (!of_prop_cmp(prop_fix->name, "name") || 165 - !of_prop_cmp(prop_fix->name, "phandle") || 166 - !of_prop_cmp(prop_fix->name, "linux,phandle")) 164 + if (is_pseudo_property(prop_fix->name)) 167 165 continue; 168 166 169 167 if ((prop_fix->length % 4) != 0 || prop_fix->length == 0)