Skip to content

Commit b106492

Browse files
robherringlinusw
authored andcommitted
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) <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent cd7d3f4 commit b106492

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/pinctrl/mediatek/pinctrl-paris.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,11 +1044,8 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev)
10441044

10451045
hw->nbase = hw->soc->nbase_names;
10461046

1047-
if (of_find_property(hw->dev->of_node,
1048-
"mediatek,rsel-resistance-in-si-unit", NULL))
1049-
hw->rsel_si_unit = true;
1050-
else
1051-
hw->rsel_si_unit = false;
1047+
hw->rsel_si_unit = of_property_read_bool(hw->dev->of_node,
1048+
"mediatek,rsel-resistance-in-si-unit");
10521049

10531050
spin_lock_init(&hw->lock);
10541051

0 commit comments

Comments
 (0)