gpio: Use of_property_read_bool() for boolean properties
authorRob Herring <robh@kernel.org>
Tue, 14 Mar 2023 15:41:17 +0000 (10:41 -0500)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 15 Mar 2023 09:43:08 +0000 (10:43 +0100)
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-stp-xway.c
drivers/gpio/gpio-tb10x.c

index 0ce1543426a4aa6d73d4096f71241e27b7bf9eb5..4750ea34204c97b1c56b8745e2b95a73fdde9cbf 100644 (file)
@@ -292,7 +292,7 @@ static int xway_stp_probe(struct platform_device *pdev)
        }
 
        /* check which edge trigger we should use, default to a falling edge */
-       if (!of_find_property(pdev->dev.of_node, "lantiq,rising", NULL))
+       if (!of_property_read_bool(pdev->dev.of_node, "lantiq,rising"))
                chip->edge = XWAY_STP_FALLING;
 
        clk = devm_clk_get(&pdev->dev, NULL);
index de6afa3f971683d6c85d7678b9708bb2e60b855c..78f8790168ae1e4bad29229970cec99ff6f52d9b 100644 (file)
@@ -167,7 +167,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, tb10x_gpio);
 
-       if (of_find_property(np, "interrupt-controller", NULL)) {
+       if (of_property_read_bool(np, "interrupt-controller")) {
                struct irq_chip_generic *gc;
 
                ret = platform_get_irq(pdev, 0);