clk: Use of_property_present()
PATCH 1/1 clk: Use of_property_present()
Use of_property_present() to test for property presence rather than of_(find|get)_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_(find|get)_property() leak the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed.
--- drivers/clk/clk.c | 2 +- drivers/clk/renesas/clk-mstp.c | 2 +- drivers/clk/versatile/clk-sp810.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/clk/clk.c +1 -1
@@ -5232,7 +5232,7 @@ static int of_parse_clkspec(const struct device_node *np, int index,* clocks. */ np = np->parent; -if (np && !of_get_property (np,"clock-ranges" ,NULL )) +if (np && !of_property_present (np,"clock-ranges" ))break ; index =0 ; }
drivers/clk/renesas/clk-mstp.c +1 -1
@@ -207,7 +207,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)for (i =0 ; i <MSTP_MAX_CLOCKS ; ++i) clks[i] =ERR_PTR (-ENOENT ); -if (of_find_property (np,"clock-indices" , &i)) +if (of_property_present (np,"clock-indices" )) idxname ="clock-indices" ;else idxname ="renesas,clock-indices" ;
drivers/clk/versatile/clk-sp810.c +1 -1
@@ -110,7 +110,7 @@ static void __init clk_sp810_of_setup(struct device_node *node) init.parent_names = parent_names; init.num_parents = num; - deprecated = !of_find_property (node,"assigned-clock-parents" ,NULL ); + deprecated = !of_property_present (node,"assigned-clock-parents" );for (i =0 ; i <ARRAY_SIZE (sp810->timerclken); i++) {snprintf (name,sizeof (name),"sp810_%d_%d" , instance, i);
Signature · 1 line
2.43.0
Quoted 7 lines · Rob Herring (Arm)
Use
of_property_present()to test for property presence rather than of_(find|get)_property(). This is part of a larger effort to remove callers ofof_find_property()and similar functions. of_(find|get)_property() leak 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]>
Yours,
Linus Walleij
Quoted 7 lines · Rob Herring (Arm)
Use
of_property_present()to test for property presence rather than of_(find|get)_property(). This is part of a larger effort to remove callers ofof_find_property()and similar functions. of_(find|get)_property() leak 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]>
Quoted 1 line
drivers/clk/renesas/clk-mstp.c | 2 +-
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
Quoting Rob Herring (Arm) (2024-07-31 12:12:42)
Quoted 8 lines
Use
of_property_present()to test for property presence rather than of_(find|get)_property(). This is part of a larger effort to remove callers ofof_find_property()and similar functions. of_(find|get)_property() leak 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]>---
Applied to clk-next