[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241206-of_core_fix-v1-10-dc28ed56bec3@quicinc.com>
Date: Fri, 06 Dec 2024 08:52:36 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
Leif Lindholm <leif.lindholm@...aro.org>,
Stephen Boyd <stephen.boyd@...aro.org>, Maxime Ripard <mripard@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Grant Likely <grant.likely@...retlab.ca>
Cc: Zijun Hu <zijun_hu@...oud.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH 10/10] of: Simplify API of_find_node_with_property()
implementation
From: Zijun Hu <quic_zijuhu@...cinc.com>
Simplify of_find_node_with_property() implementation
by __of_find_property().
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
drivers/of/base.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 33abb6227468c03fd191201aa2bbe05a41fdd9f4..5fc061b66116d106c398f04a1d9d235f09741de7 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -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;
--
2.34.1
Powered by blists - more mailing lists