mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 05:26:07 +00:00
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>
This commit is contained in:
parent
4ff899ee4e
commit
4bc244f681
@ -1026,19 +1026,15 @@ struct device_node *of_find_node_with_property(struct device_node *from,
|
||||
const char *prop_name)
|
||||
{
|
||||
struct device_node *np;
|
||||
const struct property *pp;
|
||||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&devtree_lock, flags);
|
||||
for_each_of_allnodes_from(from, np) {
|
||||
for (pp = np->properties; pp; pp = pp->next) {
|
||||
if (of_prop_cmp(pp->name, prop_name) == 0) {
|
||||
of_node_get(np);
|
||||
goto out;
|
||||
}
|
||||
if (__of_find_property(np, prop_name, NULL)) {
|
||||
of_node_get(np);
|
||||
break;
|
||||
}
|
||||
}
|
||||
out:
|
||||
of_node_put(from);
|
||||
raw_spin_unlock_irqrestore(&devtree_lock, flags);
|
||||
return np;
|
||||
|
Loading…
x
Reference in New Issue
Block a user