[PATCH v4 04/14] of: property: Use of_property_present() for of_fwnode_property_present()

From: Zijun Hu
Date: Thu Jan 09 2025 - 08:29:07 EST


From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>

Use of_property_present() instead of of_property_read_bool() for
of_fwnode_property_present() since the former is more applicable
obviously.

Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>

---
Hi Rob,

i pick up this change again after some considerations as below:

1) of_property_present() is more suitable than of_property_read_bool()
here, deprecated API is not main reason.

2) it does not conflict with your job which warns when use
of_property_read_bool() for non-bool property.
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 519bf9229e613906547b57d8c68e7b8558eff327..dca1a3ebccae1093b2b11f51e8e692bca854d0e3 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -966,7 +966,7 @@ of_fwnode_device_get_dma_attr(const struct fwnode_handle *fwnode)
static bool of_fwnode_property_present(const struct fwnode_handle *fwnode,
const char *propname)
{
- return of_property_read_bool(to_of_node(fwnode), propname);
+ return of_property_present(to_of_node(fwnode), propname);
}

static int of_fwnode_property_read_int_array(const struct fwnode_handle *fwnode,

--
2.34.1