Skip to contentSkip to conversation

mtd: hyperbus: Use of_property_present() for non-boolean properties

PATCH In review Rob Herring (Arm) 3 participants 3 messages Jan 9, 2025 – Jan 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: hyperbus: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 drivers/mtd/hyperbus/hbmc-am654.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/hyperbus/hbmc-am654.c +1 -1
index 217f4e69233f..60bdce4391cd 100644
@@ -176,7 +176,7 @@ static int am654_hbmc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (of_property_read_bool(dev->of_node, "mux-controls")) {
+	if (of_property_present(dev->of_node, "mux-controls")) {
 		struct mux_control *control = devm_mux_control_get(dev, NULL);
 
 		if (IS_ERR(control))
Signature · 1 line
2.45.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rob Herring (Arm)

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

Quoted 17 lines
---
 drivers/mtd/hyperbus/hbmc-am654.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/hyperbus/hbmc-am654.c +1 -1
index 217f4e69233f..60bdce4391cd 100644
@@ -176,7 +176,7 @@ static int am654_hbmc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (of_property_read_bool(dev->of_node, "mux-controls")) {
+	if (of_property_present(dev->of_node, "mux-controls")) {
 		struct mux_control *control = devm_mux_control_get(dev, NULL);
 
 		if (IS_ERR(control))
maintainer
#2 lore raw
In reply to Rob Herring (Arm)

Hi Rob,

Quoted 3 lines · Rob Herring (Arm)

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

This patch did not apply because of another unrelated change in my tree touching the return paths in this driver, I fixed it while applying.

Thanks,
Miquèl