summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRob Herring (Arm) <robh@kernel.org>2024-07-31 13:13:01 -0600
committerLinus Walleij <linus.walleij@linaro.org>2024-08-23 17:38:00 +0200
commitb106492686efcff523425eaf956cb4cb31555a61 (patch)
tree439e59c3b351c4d6ca2dde50397b09036c3cc768 /drivers
parentcd7d3f4f9756df0b14e5c91d6ba072372033ba18 (diff)
pinctrl: mediatek: Use of_property_read_bool()
Use of_property_read_bool() to read boolean properties rather than of_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/20240731191312.1710417-23-robh@kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-paris.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index e12316c42698..87e958d827bf 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -1044,11 +1044,8 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev)
hw->nbase = hw->soc->nbase_names;
- if (of_find_property(hw->dev->of_node,
- "mediatek,rsel-resistance-in-si-unit", NULL))
- hw->rsel_si_unit = true;
- else
- hw->rsel_si_unit = false;
+ hw->rsel_si_unit = of_property_read_bool(hw->dev->of_node,
+ "mediatek,rsel-resistance-in-si-unit");
spin_lock_init(&hw->lock);