Skip to content

Commit aa85d45

Browse files
robherringkrzk
authored andcommitted
pinctrl: samsung: Use of_property_present()
Use of_property_present() to test for property presence 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 8400291 commit aa85d45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,16 +823,16 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions(
823823
struct device_node *func_np;
824824

825825
if (!of_get_child_count(cfg_np)) {
826-
if (!of_find_property(cfg_np,
827-
"samsung,pin-function", NULL))
826+
if (!of_property_present(cfg_np,
827+
"samsung,pin-function"))
828828
continue;
829829
++func_cnt;
830830
continue;
831831
}
832832

833833
for_each_child_of_node(cfg_np, func_np) {
834-
if (!of_find_property(func_np,
835-
"samsung,pin-function", NULL))
834+
if (!of_property_present(func_np,
835+
"samsung,pin-function"))
836836
continue;
837837
++func_cnt;
838838
}

0 commit comments

Comments
 (0)