summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-stmfx.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 17:47:20 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-03-23 11:28:38 +0300
commite0e8fbf84628f3aa80a01ba28db7921224f5d7b9 (patch)
treefac76918ca4ab0890aaffd393a339a3146c280be /drivers/pinctrl/pinctrl-stmfx.c
parentd11f932808dc689717e409bbc81b5093e7902fc9 (diff)
downloadlinux-e0e8fbf84628f3aa80a01ba28db7921224f5d7b9.tar.xz
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. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230310144721.1544669-1-robh@kernel.org [Dropped hunk hitting drivers/pinctrl/renesas/pinctrl.c] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-stmfx.c')
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index 1181c4b506b1..3c031692e44d 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -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;
}