of: Use of_property_present() helper
authorRob Herring <robh@kernel.org>
Thu, 9 Feb 2023 23:20:43 +0000 (17:20 -0600)
committerRob Herring <robh@kernel.org>
Fri, 17 Feb 2023 21:21:36 +0000 (15:21 -0600)
Use of_property_present() instead of of_get_property/of_find_property()
in places where we just need to test presence of a property.

Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Tested-by: Frank Rowand <frowand.list@gmail.com>
Link: https://lore.kernel.org/all/20230215215547.691573-2-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/platform.c
drivers/of/property.c

index 81c8c227ab6bf259bab344b1cfea5e5d6024763f..f7d796b540392d197f28bf73e541e8223a1ed751 100644 (file)
@@ -528,7 +528,7 @@ static int __init of_platform_default_populate_init(void)
                int ret;
 
                /* Check if we have a MacOS display without a node spec */
-               if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL)) {
+               if (of_property_present(of_chosen, "linux,bootx-noscreen")) {
                        /*
                         * The old code tried to work out which node was the MacOS
                         * display based on the address. I'm dropping that since the
index 134cfc980b70b307aa820a056bbc58df6eb700df..ff71d2ac26cb7d94e561471e4fdce2ce18c2a17b 100644 (file)
@@ -1086,7 +1086,7 @@ static struct device_node *of_get_compat_node(struct device_node *np)
                        np = NULL;
                }
 
-               if (of_find_property(np, "compatible", NULL))
+               if (of_property_present(np, "compatible"))
                        break;
 
                np = of_get_next_parent(np);