diff mbox series

memory: omap-gpmc: Use of_property_present() for non-boolean properties

Message ID 20250109182110.3970894-1-robh@kernel.org
State New
Headers show
Series memory: omap-gpmc: Use of_property_present() for non-boolean properties | expand

Commit Message

Rob Herring Jan. 9, 2025, 6:21 p.m. UTC
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

While we're here, simplify the 2 checks into a single check as they
only differ in printing "NAND" vs "OneNAND" in the warning.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
Possibly this check could just be removed altogether?
---
 drivers/memory/omap-gpmc.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index e2a75a52563f..329bad46065c 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2226,21 +2226,11 @@  static int gpmc_probe_generic_child(struct platform_device *pdev,
 		goto err;
 	}
 
-	if (of_node_name_eq(child, "nand")) {
+	if (of_node_name_eq(child, "nand") || of_node_name_eq(child, "onenand")) {
 		/* Warn about older DT blobs with no compatible property */
-		if (!of_property_read_bool(child, "compatible")) {
+		if (!of_property_present(child, "compatible")) {
 			dev_warn(&pdev->dev,
-				 "Incompatible NAND node: missing compatible");
-			ret = -EINVAL;
-			goto err;
-		}
-	}
-
-	if (of_node_name_eq(child, "onenand")) {
-		/* Warn about older DT blobs with no compatible property */
-		if (!of_property_read_bool(child, "compatible")) {
-			dev_warn(&pdev->dev,
-				 "Incompatible OneNAND node: missing compatible");
+				 "Incompatible '%pOFn' node: missing compatible", child);
 			ret = -EINVAL;
 			goto err;
 		}