of: Use preferred of_property_read_* functions
authorRob Herring <robh@kernel.org>
Wed, 8 Feb 2023 23:13:23 +0000 (17:13 -0600)
committerRob Herring <robh@kernel.org>
Fri, 17 Feb 2023 21:46:20 +0000 (15:46 -0600)
Replace instances of of_get_property/of_find_property() with appropriate
typed of_property_read_*() functions.

Link: https://lore.kernel.org/all/20230215215502.690716-1-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/platform.c
drivers/of/property.c

index f7d796b540392d197f28bf73e541e8223a1ed751..9f015ad73288f44498c1ce5f13f3cc719a84b2d6 100644 (file)
@@ -222,7 +222,6 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
                                                 struct device *parent)
 {
        struct amba_device *dev;
-       const void *prop;
        int ret;
 
        pr_debug("Creating amba device %pOF\n", node);
@@ -250,9 +249,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
                of_device_make_bus_id(&dev->dev);
 
        /* Allow the HW Peripheral ID to be overridden */
-       prop = of_get_property(node, "arm,primecell-periphid", NULL);
-       if (prop)
-               dev->periphid = of_read_ulong(prop, 1);
+       of_property_read_u32(node, "arm,primecell-periphid", &dev->periphid);
 
        ret = of_address_to_resource(node, 0, &dev->res);
        if (ret) {
index ff71d2ac26cb7d94e561471e4fdce2ce18c2a17b..a229536f756401df4442223e3c221fe53f1ff367 100644 (file)
@@ -1358,7 +1358,7 @@ static struct device_node *parse_gpio_compat(struct device_node *np,
         * Ignore node with gpio-hog property since its gpios are all provided
         * by its parent.
         */
-       if (of_find_property(np, "gpio-hog", NULL))
+       if (of_property_read_bool(np, "gpio-hog"))
                return NULL;
 
        if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,