Skip to contentSkip to conversation

pinctrl: Use of_property_present() for testing DT property presence

PATCH In review Rob Herring 6 participants 10 messages Mar 10, 2023 – Mar 23, 2023

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: Use of_property_present() for testing DT property presence

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

---
 drivers/pinctrl/mediatek/pinctrl-moore.c |  2 +-
 drivers/pinctrl/pinctrl-single.c         |  4 ++--
 drivers/pinctrl/pinctrl-stmfx.c          |  2 +-
 drivers/pinctrl/renesas/pinctrl.c        |  4 ++--
 drivers/pinctrl/stm32/pinctrl-stm32.c    |  2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c    | 20 ++++++++++----------
 6 files changed, 17 insertions(+), 17 deletions(-)
drivers/pinctrl/mediatek/pinctrl-moore.c +1 -1
index 007b98ce5631..8649a2f9d324 100644
@@ -586,7 +586,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
 	 * Documentation/devicetree/bindings/gpio/gpio.txt on how to
 	 * bind pinctrl and gpio drivers via the "gpio-ranges" property.
 	 */
-	if (!of_find_property(hw->dev->of_node, "gpio-ranges", NULL)) {
+	if (!of_property_present(hw->dev->of_node, "gpio-ranges")) {
 		ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 0, 0,
 					     chip->ngpio);
 		if (ret < 0) {
drivers/pinctrl/pinctrl-single.c +2 -2
index 190923757cda..0dabbcf68b9f 100644
@@ -939,11 +939,11 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 
 	/* cacluate how much properties are supported in current node */
 	for (i = 0; i < ARRAY_SIZE(prop2); i++) {
-		if (of_find_property(np, prop2[i].name, NULL))
+		if (of_property_present(np, prop2[i].name))
 			nconfs++;
 	}
 	for (i = 0; i < ARRAY_SIZE(prop4); i++) {
-		if (of_find_property(np, prop4[i].name, NULL))
+		if (of_property_present(np, prop4[i].name))
 			nconfs++;
 	}
 	if (!nconfs)
drivers/pinctrl/pinctrl-stmfx.c +1 -1
index 1181c4b506b1..3c031692e44d 100644
@@ -632,7 +632,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 	pctl->dev = &pdev->dev;
 	pctl->stmfx = stmfx;
 
-	if (!of_find_property(np, "gpio-ranges", NULL)) {
+	if (!of_property_present(np, "gpio-ranges")) {
 		dev_err(pctl->dev, "missing required gpio-ranges property\n");
 		return -EINVAL;
 	}
drivers/pinctrl/renesas/pinctrl.c +2 -2
index b74147800319..5c71e168b370 100644
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 	 * inside a subnode nor across subnodes.
 	 */
 	if (!pmx->func_prop_name) {
-		if (of_find_property(np, "groups", NULL) ||
-		    of_find_property(np, "pins", NULL)) {
+		if (of_property_present(np, "groups")||
+		    of_property_present(np, "pins")) {
 			pmx->func_prop_name = "function";
 			pmx->groups_prop_name = "groups";
 			pmx->pins_prop_name = "pins";
drivers/pinctrl/stm32/pinctrl-stm32.c +1 -1
index cb33a23ab0c1..66a25becd8f5 100644
@@ -1374,7 +1374,7 @@ static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pde
 	struct device_node *parent;
 	struct irq_domain *domain;
 
-	if (!of_find_property(np, "interrupt-parent", NULL))
+	if (!of_property_present(np, "interrupt-parent"))
 		return NULL;
 
 	parent = of_irq_find_parent(np);
drivers/pinctrl/sunxi/pinctrl-sunxi.c +10 -10
index f35179eceb4e..1dc1882cbdd7 100644
@@ -224,16 +224,16 @@ static int sunxi_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
 
 static bool sunxi_pctrl_has_bias_prop(struct device_node *node)
 {
-	return of_find_property(node, "bias-pull-up", NULL) ||
-		of_find_property(node, "bias-pull-down", NULL) ||
-		of_find_property(node, "bias-disable", NULL) ||
-		of_find_property(node, "allwinner,pull", NULL);
+	return of_property_present(node, "bias-pull-up") ||
+		of_property_present(node, "bias-pull-down") ||
+		of_property_present(node, "bias-disable") ||
+		of_property_present(node, "allwinner,pull");
 }
 
 static bool sunxi_pctrl_has_drive_prop(struct device_node *node)
 {
-	return of_find_property(node, "drive-strength", NULL) ||
-		of_find_property(node, "allwinner,drive", NULL);
+	return of_property_present(node, "drive-strength") ||
+		of_property_present(node, "allwinner,drive");
 }
 
 static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
@@ -241,13 +241,13 @@ static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
 	u32 val;
 
 	/* Try the new style binding */
-	if (of_find_property(node, "bias-pull-up", NULL))
+	if (of_property_present(node, "bias-pull-up"))
 		return PIN_CONFIG_BIAS_PULL_UP;
 
-	if (of_find_property(node, "bias-pull-down", NULL))
+	if (of_property_present(node, "bias-pull-down"))
 		return PIN_CONFIG_BIAS_PULL_DOWN;
 
-	if (of_find_property(node, "bias-disable", NULL))
+	if (of_property_present(node, "bias-disable"))
 		return PIN_CONFIG_BIAS_DISABLE;
 
 	/* And fall back to the old binding */
@@ -1424,7 +1424,7 @@ static int sunxi_pinctrl_setup_debounce(struct sunxi_pinctrl *pctl,
 		return 0;
 
 	/* If we don't have any setup, bail out */
-	if (!of_find_property(node, "input-debounce", NULL))
+	if (!of_property_present(node, "input-debounce"))
 		return 0;
 
 	losc = devm_clk_get(pctl->dev, "losc");
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw

Il 10/03/23 15:47, Rob Herring ha scritto:

Quoted 8 lines

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Rob Herring

Hi Rob,

Quoted 8 lines · Rob Herring

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Thanks for your patch!

drivers/pinctrl/renesas/pinctrl.c static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev, · line 132

Quoted 13 lines
drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
         * inside a subnode nor across subnodes.
         */
        if (!pmx->func_prop_name) {
-               if (of_find_property(np, "groups", NULL) ||
-                   of_find_property(np, "pins", NULL)) {
+               if (of_property_present(np, "groups")||
+                   of_property_present(np, "pins")) {
                        pmx->func_prop_name = "function";
                        pmx->groups_prop_name = "groups";
                        pmx->pins_prop_name = "pins";

This check is used to auto-detect if the standard property names should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10, perhaps I should just remove these checks instead?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw
Quoted 28 lines · Geert Uytterhoeven
Quoted 8 lines · Rob Herring

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Thanks for your patch!

drivers/pinctrl/renesas/pinctrl.c static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev, · line 132

Quoted 13 lines
drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
         * inside a subnode nor across subnodes.
         */
        if (!pmx->func_prop_name) {
-               if (of_find_property(np, "groups", NULL) ||
-                   of_find_property(np, "pins", NULL)) {
+               if (of_property_present(np, "groups")||
+                   of_property_present(np, "pins")) {
                        pmx->func_prop_name = "function";
                        pmx->groups_prop_name = "groups";
                        pmx->pins_prop_name = "pins";
Quoted 4 lines

This check is used to auto-detect if the standard property names should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10, perhaps I should just remove these checks instead?

Sent a patch just doing that, so you can drop this chunk.
https://lore.kernel.org/linux-renesas-soc/ff9c14781110bbf19b56b45dd1f01e6da90319ad.1678704441.git.geert+renesas@glider.be

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw
Quoted 30 lines · Geert Uytterhoeven
Quoted 28 lines · Geert Uytterhoeven
Quoted 8 lines · Rob Herring

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Thanks for your patch!

drivers/pinctrl/renesas/pinctrl.c static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev, · line 132

Quoted 13 lines
drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
         * inside a subnode nor across subnodes.
         */
        if (!pmx->func_prop_name) {
-               if (of_find_property(np, "groups", NULL) ||
-                   of_find_property(np, "pins", NULL)) {
+               if (of_property_present(np, "groups")||
+                   of_property_present(np, "pins")) {
                        pmx->func_prop_name = "function";
                        pmx->groups_prop_name = "groups";
                        pmx->pins_prop_name = "pins";
Quoted 7 lines
Quoted 4 lines

This check is used to auto-detect if the standard property names should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10, perhaps I should just remove these checks instead?

Sent a patch just doing that, so you can drop this chunk.
https://lore.kernel.org/linux-renesas-soc/ff9c14781110bbf19b56b45dd1f01e6da90319ad.1678704441.git.geert+renesas@glider.be

So I need a new version of this patch before I can apply it I guess, or there will be conflict with Reseas stuff?

Yours,
Linus Walleij

#5 lore raw

Hi Linus,

Quoted 37 lines · Linus Walleij
Quoted 35 lines · Geert Uytterhoeven
Quoted 32 lines · Geert Uytterhoeven
Quoted 8 lines · Rob Herring

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Thanks for your patch!

drivers/pinctrl/renesas/pinctrl.c static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev, · line 132

Quoted 13 lines
drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
         * inside a subnode nor across subnodes.
         */
        if (!pmx->func_prop_name) {
-               if (of_find_property(np, "groups", NULL) ||
-                   of_find_property(np, "pins", NULL)) {
+               if (of_property_present(np, "groups")||
+                   of_property_present(np, "pins")) {
                        pmx->func_prop_name = "function";
                        pmx->groups_prop_name = "groups";
                        pmx->pins_prop_name = "pins";

This check is used to auto-detect if the standard property names should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10, perhaps I should just remove these checks instead?

Quoted 5 lines
Quoted 2 lines

Sent a patch just doing that, so you can drop this chunk.
https://lore.kernel.org/linux-renesas-soc/ff9c14781110bbf19b56b45dd1f01e6da90319ad.1678704441.git.geert+renesas@glider.be

So I need a new version of this patch before I can apply it I guess, or there will be conflict with Reseas stuff?

It would be a minor conflict, though, and you would have to resolve that yourself, when merging my renesas-pinctrl PR. So when you will send a PR to The Other Linus, there won't be a conflict anymore, and no angriness ;-)

Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#6 lore raw
In reply to Linus Walleij
Quoted 38 lines · Linus Walleij
Quoted 35 lines · Geert Uytterhoeven
Quoted 32 lines · Geert Uytterhoeven
Quoted 8 lines · Rob Herring

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Thanks for your patch!

drivers/pinctrl/renesas/pinctrl.c static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev, · line 132

Quoted 13 lines
drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
         * inside a subnode nor across subnodes.
         */
        if (!pmx->func_prop_name) {
-               if (of_find_property(np, "groups", NULL) ||
-                   of_find_property(np, "pins", NULL)) {
+               if (of_property_present(np, "groups")||
+                   of_property_present(np, "pins")) {
                        pmx->func_prop_name = "function";
                        pmx->groups_prop_name = "groups";
                        pmx->pins_prop_name = "pins";

This check is used to auto-detect if the standard property names should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10, perhaps I should just remove these checks instead?

Quoted 5 lines
Quoted 2 lines

Sent a patch just doing that, so you can drop this chunk.
https://lore.kernel.org/linux-renesas-soc/ff9c14781110bbf19b56b45dd1f01e6da90319ad.1678704441.git.geert+renesas@glider.be

So I need a new version of this patch before I can apply it I guess, or there will be conflict with Reseas stuff?

Can you just drop drivers/pinctrl/renesas/pinctrl.c from this patch?

Rob

#7 lore raw
Quoted 4 lines · Rob Herring
Quoted 2 lines

So I need a new version of this patch before I can apply it I guess, or there will be conflict with Reseas stuff?

Can you just drop drivers/pinctrl/renesas/pinctrl.c from this patch?

You just exposed how lazy I am ;)

OK I did that, patch applied sans the renesas hunk.

Yours,
Linus Walleij

#8 lore raw
In reply to Rob Herring
Quoted 7 lines · On Fri, 10 Mar 2023 08:47:20 -0600 Rob Herring <[email protected]> wrote:

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Quoted 8 lines
---
 drivers/pinctrl/mediatek/pinctrl-moore.c |  2 +-
 drivers/pinctrl/pinctrl-single.c         |  4 ++--
 drivers/pinctrl/pinctrl-stmfx.c          |  2 +-
 drivers/pinctrl/renesas/pinctrl.c        |  4 ++--
 drivers/pinctrl/stm32/pinctrl-stm32.c    |  2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c    | 20 ++++++++++----------

For sunxi: Reviewed-by: Andre Przywara <[email protected]>

Cheers,
Andre

Quoted 127 lines
 6 files changed, 17 insertions(+), 17 deletions(-)
drivers/pinctrl/mediatek/pinctrl-moore.c +1 -1
index 007b98ce5631..8649a2f9d324 100644
@@ -586,7 +586,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
 	 * Documentation/devicetree/bindings/gpio/gpio.txt on how to
 	 * bind pinctrl and gpio drivers via the "gpio-ranges" property.
 	 */
-	if (!of_find_property(hw->dev->of_node, "gpio-ranges", NULL)) {
+	if (!of_property_present(hw->dev->of_node, "gpio-ranges")) {
 		ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 0, 0,
 					     chip->ngpio);
 		if (ret < 0) {
drivers/pinctrl/pinctrl-single.c +2 -2
index 190923757cda..0dabbcf68b9f 100644
@@ -939,11 +939,11 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 
 	/* cacluate how much properties are supported in current node */
 	for (i = 0; i < ARRAY_SIZE(prop2); i++) {
-		if (of_find_property(np, prop2[i].name, NULL))
+		if (of_property_present(np, prop2[i].name))
 			nconfs++;
 	}
 	for (i = 0; i < ARRAY_SIZE(prop4); i++) {
-		if (of_find_property(np, prop4[i].name, NULL))
+		if (of_property_present(np, prop4[i].name))
 			nconfs++;
 	}
 	if (!nconfs)
drivers/pinctrl/pinctrl-stmfx.c +1 -1
index 1181c4b506b1..3c031692e44d 100644
@@ -632,7 +632,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 	pctl->dev = &pdev->dev;
 	pctl->stmfx = stmfx;
 
-	if (!of_find_property(np, "gpio-ranges", NULL)) {
+	if (!of_property_present(np, "gpio-ranges")) {
 		dev_err(pctl->dev, "missing required gpio-ranges property\n");
 		return -EINVAL;
 	}
drivers/pinctrl/renesas/pinctrl.c +2 -2
index b74147800319..5c71e168b370 100644
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 	 * inside a subnode nor across subnodes.
 	 */
 	if (!pmx->func_prop_name) {
-		if (of_find_property(np, "groups", NULL) ||
-		    of_find_property(np, "pins", NULL)) {
+		if (of_property_present(np, "groups")||
+		    of_property_present(np, "pins")) {
 			pmx->func_prop_name = "function";
 			pmx->groups_prop_name = "groups";
 			pmx->pins_prop_name = "pins";
drivers/pinctrl/stm32/pinctrl-stm32.c +1 -1
index cb33a23ab0c1..66a25becd8f5 100644
@@ -1374,7 +1374,7 @@ static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pde
 	struct device_node *parent;
 	struct irq_domain *domain;
 
-	if (!of_find_property(np, "interrupt-parent", NULL))
+	if (!of_property_present(np, "interrupt-parent"))
 		return NULL;
 
 	parent = of_irq_find_parent(np);
drivers/pinctrl/sunxi/pinctrl-sunxi.c +10 -10
index f35179eceb4e..1dc1882cbdd7 100644
@@ -224,16 +224,16 @@ static int sunxi_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
 
 static bool sunxi_pctrl_has_bias_prop(struct device_node *node)
 {
-	return of_find_property(node, "bias-pull-up", NULL) ||
-		of_find_property(node, "bias-pull-down", NULL) ||
-		of_find_property(node, "bias-disable", NULL) ||
-		of_find_property(node, "allwinner,pull", NULL);
+	return of_property_present(node, "bias-pull-up") ||
+		of_property_present(node, "bias-pull-down") ||
+		of_property_present(node, "bias-disable") ||
+		of_property_present(node, "allwinner,pull");
 }
 
 static bool sunxi_pctrl_has_drive_prop(struct device_node *node)
 {
-	return of_find_property(node, "drive-strength", NULL) ||
-		of_find_property(node, "allwinner,drive", NULL);
+	return of_property_present(node, "drive-strength") ||
+		of_property_present(node, "allwinner,drive");
 }
 
 static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
@@ -241,13 +241,13 @@ static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
 	u32 val;
 
 	/* Try the new style binding */
-	if (of_find_property(node, "bias-pull-up", NULL))
+	if (of_property_present(node, "bias-pull-up"))
 		return PIN_CONFIG_BIAS_PULL_UP;
 
-	if (of_find_property(node, "bias-pull-down", NULL))
+	if (of_property_present(node, "bias-pull-down"))
 		return PIN_CONFIG_BIAS_PULL_DOWN;
 
-	if (of_find_property(node, "bias-disable", NULL))
+	if (of_property_present(node, "bias-disable"))
 		return PIN_CONFIG_BIAS_DISABLE;
 
 	/* And fall back to the old binding */
@@ -1424,7 +1424,7 @@ static int sunxi_pinctrl_setup_debounce(struct sunxi_pinctrl *pctl,
 		return 0;
 
 	/* If we don't have any setup, bail out */
-	if (!of_find_property(node, "input-debounce", NULL))
+	if (!of_property_present(node, "input-debounce"))
 		return 0;
 
 	losc = devm_clk_get(pctl->dev, "losc");
maintainer Reviewed-by on v1 1/1
#9 lore raw
In reply to Rob Herring

Dne petek, 10. marec 2023 ob 15:47:20 CET je Rob Herring napisal(a):

Quoted 7 lines

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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.

Quoted 8 lines
---
 drivers/pinctrl/mediatek/pinctrl-moore.c |  2 +-
 drivers/pinctrl/pinctrl-single.c         |  4 ++--
 drivers/pinctrl/pinctrl-stmfx.c          |  2 +-
 drivers/pinctrl/renesas/pinctrl.c        |  4 ++--
 drivers/pinctrl/stm32/pinctrl-stm32.c    |  2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c    | 20 ++++++++++----------

For sunxi:

Best regards,
Jernej

Quoted 8 lines
 6 files changed, 17 insertions(+), 17 deletions(-)
(quoted diff) +0 -0

b/drivers/pinctrl/mediatek/pinctrl-moore.c index 007b98ce5631..8649a2f9d324 100644

drivers/pinctrl/mediatek/pinctrl-moore.c static int mtk_build_gpiochip(struct mtk_pinctrl *hw) · line 590

Quoted 6 lines
drivers/pinctrl/mediatek/pinctrl-moore.c +1 -1
@@ -586,7 +586,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
 	 * Documentation/devicetree/bindings/gpio/gpio.txt on how to
 	 * bind pinctrl and gpio drivers via the "gpio-ranges" property.
 	 */
-	if (!of_find_property(hw->dev->of_node, "gpio-ranges", NULL)) {
+	if (!of_property_present(hw->dev->of_node, "gpio-ranges")) {
 		ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 

0, 0,

Quoted 26 lines
drivers/pinctrl/mediatek/pinctrl-moore.c +0 -0
 					     chip->ngpio);
 		if (ret < 0) {
(quoted diff) +0 -0

b/drivers/pinctrl/pinctrl-single.c index 190923757cda..0dabbcf68b9f 100644

drivers/pinctrl/pinctrl-single.c +2 -2
@@ -939,11 +939,11 @@ static int pcs_parse_pinconf(struct pcs_device *pcs,
 struct device_node *np,
 
 	/* cacluate how much properties are supported in current node */
 	for (i = 0; i < ARRAY_SIZE(prop2); i++) {
-		if (of_find_property(np, prop2[i].name, NULL))
+		if (of_property_present(np, prop2[i].name))
 			nconfs++;
 	}
 	for (i = 0; i < ARRAY_SIZE(prop4); i++) {
-		if (of_find_property(np, prop4[i].name, NULL))
+		if (of_property_present(np, prop4[i].name))
 			nconfs++;
 	}
drivers/pinctrl/pinctrl-single.c +0 -0
 	if (!nconfs)
(quoted diff) +0 -0

b/drivers/pinctrl/pinctrl-stmfx.c index 1181c4b506b1..3c031692e44d 100644

drivers/pinctrl/pinctrl-stmfx.c static int stmfx_pinctrl_probe(struct platform_device · line 636

Quoted 6 lines
drivers/pinctrl/pinctrl-stmfx.c +1 -1
@@ -632,7 +632,7 @@ static int stmfx_pinctrl_probe(struct platform_device
 *pdev) pctl->dev = &pdev->dev;
 	pctl->stmfx = stmfx;
 
-	if (!of_find_property(np, "gpio-ranges", NULL)) {
+	if (!of_property_present(np, "gpio-ranges")) {
 		dev_err(pctl->dev, "missing required gpio-ranges 

property\n");

Quoted 87 lines
drivers/pinctrl/pinctrl-stmfx.c +0 -0
 		return -EINVAL;
 	}
(quoted diff) +0 -0

b/drivers/pinctrl/renesas/pinctrl.c index b74147800319..5c71e168b370 100644

drivers/pinctrl/renesas/pinctrl.c +2 -2
@@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev
 *pctldev, * inside a subnode nor across subnodes.
 	 */
 	if (!pmx->func_prop_name) {
-		if (of_find_property(np, "groups", NULL) ||
-		    of_find_property(np, "pins", NULL)) {
+		if (of_property_present(np, "groups")||
+		    of_property_present(np, "pins")) {
 			pmx->func_prop_name = "function";
 			pmx->groups_prop_name = "groups";
 			pmx->pins_prop_name = "pins";
(quoted diff) +0 -0

b/drivers/pinctrl/stm32/pinctrl-stm32.c index cb33a23ab0c1..66a25becd8f5 100644

drivers/pinctrl/stm32/pinctrl-stm32.c +1 -1
@@ -1374,7 +1374,7 @@ static struct irq_domain
 *stm32_pctrl_get_irq_domain(struct platform_device *pde struct device_node
 *parent;
 	struct irq_domain *domain;
 
-	if (!of_find_property(np, "interrupt-parent", NULL))
+	if (!of_property_present(np, "interrupt-parent"))
 		return NULL;
 
drivers/pinctrl/stm32/pinctrl-stm32.c +0 -0
 	parent = of_irq_find_parent(np);
(quoted diff) +0 -0

b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index f35179eceb4e..1dc1882cbdd7 100644

drivers/pinctrl/sunxi/pinctrl-sunxi.c +6 -6
@@ -224,16 +224,16 @@ static int sunxi_pctrl_get_group_pins(struct
 pinctrl_dev *pctldev,
 
 static bool sunxi_pctrl_has_bias_prop(struct device_node *node)
 {
-	return of_find_property(node, "bias-pull-up", NULL) ||
-		of_find_property(node, "bias-pull-down", NULL) ||
-		of_find_property(node, "bias-disable", NULL) ||
-		of_find_property(node, "allwinner,pull", NULL);
+	return of_property_present(node, "bias-pull-up") ||
+		of_property_present(node, "bias-pull-down") ||
+		of_property_present(node, "bias-disable") ||
+		of_property_present(node, "allwinner,pull");
 }
 
 static bool sunxi_pctrl_has_drive_prop(struct device_node *node)
 {
-	return of_find_property(node, "drive-strength", NULL) ||
-		of_find_property(node, "allwinner,drive", NULL);
+	return of_property_present(node, "drive-strength") ||
+		of_property_present(node, "allwinner,drive");
 }
 

static int sunxi_pctrl_parse_bias_prop(struct device_node *node)

drivers/pinctrl/sunxi/pinctrl-sunxi.c +4 -4
@@ -241,13 +241,13 @@ static int sunxi_pctrl_parse_bias_prop(struct
 device_node *node) u32 val;
 
 	/* Try the new style binding */
-	if (of_find_property(node, "bias-pull-up", NULL))
+	if (of_property_present(node, "bias-pull-up"))
 		return PIN_CONFIG_BIAS_PULL_UP;
 
-	if (of_find_property(node, "bias-pull-down", NULL))
+	if (of_property_present(node, "bias-pull-down"))
 		return PIN_CONFIG_BIAS_PULL_DOWN;
 
-	if (of_find_property(node, "bias-disable", NULL))
+	if (of_property_present(node, "bias-disable"))
 		return PIN_CONFIG_BIAS_DISABLE;
 
 	/* And fall back to the old binding */
@@ -1424,7 +1424,7 @@ static int sunxi_pinctrl_setup_debounce(struct
 sunxi_pinctrl *pctl, return 0;
 
 	/* If we don't have any setup, bail out */
-	if (!of_find_property(node, "input-debounce", NULL))
+	if (!of_property_present(node, "input-debounce"))
 		return 0;
 
 	losc = devm_clk_get(pctl->dev, "losc");