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: Simplify API of_find_node_with_property() implementation

Simplify of_find_node_with_property() implementation
by __of_find_property().

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241206-of_core_fix-v1-10-dc28ed56bec3@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Zijun Hu and committed by
Rob Herring (Arm)
4bc244f6 4ff899ee

+3 -7
+3 -7
drivers/of/base.c
··· 1026 1026 const char *prop_name) 1027 1027 { 1028 1028 struct device_node *np; 1029 - const struct property *pp; 1030 1029 unsigned long flags; 1031 1030 1032 1031 raw_spin_lock_irqsave(&devtree_lock, flags); 1033 1032 for_each_of_allnodes_from(from, np) { 1034 - for (pp = np->properties; pp; pp = pp->next) { 1035 - if (of_prop_cmp(pp->name, prop_name) == 0) { 1036 - of_node_get(np); 1037 - goto out; 1038 - } 1033 + if (__of_find_property(np, prop_name, NULL)) { 1034 + of_node_get(np); 1035 + break; 1039 1036 } 1040 1037 } 1041 - out: 1042 1038 of_node_put(from); 1043 1039 raw_spin_unlock_irqrestore(&devtree_lock, flags); 1044 1040 return np;