pinctrl: Use of_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Mon, 4 Nov 2024 19:44:36 +0000 (13:44 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 8 Nov 2024 08:02:15 +0000 (09:02 +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>
Link: https://lore.kernel.org/20241104194437.327430-1-robh@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/freescale/pinctrl-imx.c
drivers/pinctrl/pinctrl-xway.c
drivers/pinctrl/qcom/pinctrl-msm.c
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c

index d05c2c478e7950d3a251cb7d41bc5cf3671b030d..842a1e6cbfc41a2d108f90f4167dd94c457ea723 100644 (file)
@@ -633,11 +633,11 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
 static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
 {
        for_each_child_of_node_scoped(np, function_np) {
-               if (of_property_read_bool(function_np, "fsl,pins"))
+               if (of_property_present(function_np, "fsl,pins"))
                        return true;
 
                for_each_child_of_node_scoped(function_np, pinctrl_np) {
-                       if (of_property_read_bool(pinctrl_np, "fsl,pins"))
+                       if (of_property_present(pinctrl_np, "fsl,pins"))
                                return false;
                }
        }
@@ -746,7 +746,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
                if (IS_ERR(ipctl->base))
                        return PTR_ERR(ipctl->base);
 
-               if (of_property_read_bool(dev_np, "fsl,input-sel")) {
+               if (of_property_present(dev_np, "fsl,input-sel")) {
                        np = of_parse_phandle(dev_np, "fsl,input-sel", 0);
                        if (!np) {
                                dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");
index f4256a918165f4d7dda8d2c8a4adf71b141f918b..48f8aabf3bfa3ae18f3eca8ea00c6e796faf4500 100644 (file)
@@ -1524,7 +1524,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
         * 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(pdev->dev.of_node, "gpio-ranges")) {
+       if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) {
                /* finish with registering the gpio range in pinctrl */
                xway_gpio_range.npins = xway_chip.ngpio;
                xway_gpio_range.base = xway_chip.base;
index aeaf0d1958f56a614dfbbf6658f7676129657e8c..ec913c2e200f5fa584806667b9552b7e284e4fae 100644 (file)
@@ -1457,7 +1457,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
         * 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(pctrl->dev->of_node, "gpio-ranges")) {
+       if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
                ret = gpiochip_add_pin_range(&pctrl->chip,
                        dev_name(pctrl->dev), 0, 0, chip->ngpio);
                if (ret) {
index c33af2d6677846a4c43fc817e7b01621ab220890..fd238882d921e1bd4eeda05cfcf40d99f8462ba8 100644 (file)
@@ -1169,7 +1169,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
         * 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(dev->of_node, "gpio-ranges")) {
+       if (!of_property_present(dev->of_node, "gpio-ranges")) {
                ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
                                             npins);
                if (ret) {
index b750ff4db4c3e3117aeb6416e3b8e32b4be2cff9..2225dc49d477c12c0f5e1cbba4f751d8abfcbb4c 100644 (file)
@@ -832,7 +832,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
         * 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(pctrl->dev->of_node, "gpio-ranges")) {
+       if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
                ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev),
                                             0, 0, pctrl->chip.ngpio);
                if (ret) {