]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
gpio: Use of_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Mon, 4 Nov 2024 19:06:27 +0000 (13:06 -0600)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 6 Nov 2024 13:41:06 +0000 (14:41 +0100)
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20241104190628.274717-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-rockchip.c
drivers/gpio/gpiolib-of.c

index a7e115e4352adcf548b682a68c6929e4d024abb5..3250c021859f59dae20f496fe7c7121053f8d872 100644 (file)
@@ -602,7 +602,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
         * files which don't set the "gpio-ranges" property or systems that
         * utilize ACPI the driver has to call gpiochip_add_pin_range().
         */
-       if (!of_property_read_bool(bank->of_node, "gpio-ranges")) {
+       if (!of_property_present(bank->of_node, "gpio-ranges")) {
                struct device_node *pctlnp = of_get_parent(bank->of_node);
                struct pinctrl_dev *pctldev = NULL;
 
index 880f1efcaca5345af5b57eb18f11c538041ebcb9..2e537ee979f3e2b6e8d5f86f3e121a66f2a8e083 100644 (file)
@@ -337,7 +337,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
         * to determine if the flags should have inverted semantics.
         */
        if (IS_ENABLED(CONFIG_SPI_MASTER) && !strcmp(propname, "cs-gpios") &&
-           of_property_read_bool(np, "cs-gpios")) {
+           of_property_present(np, "cs-gpios")) {
                u32 cs;
                int ret;