Skip to content

Commit 810251b

Browse files
Alain Volmatbebarino
authored andcommitted
clk: st: clkgen-mux: search reg within node or parent
In order to avoid having duplicated addresses within the DT, only have one unit-address per clockgen and each driver within the clockgen should look at the parent node (overall clockgen) to figure out the reg property. Such behavior is already in place in other STi platform clock drivers such as clk-flexgen and clkgen-pll. Keep backward compatibility by first looking at reg within the node before looking into the parent node. Signed-off-by: Alain Volmat <avolmat@me.com> Link: https://lore.kernel.org/r/20211218211157.188214-3-avolmat@me.com Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 3efe64e commit 810251b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/clk/st/clkgen-mux.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@ static void __init st_of_clkgen_mux_setup(struct device_node *np,
5757
const char **parents;
5858
int num_parents = 0;
5959

60+
/*
61+
* First check for reg property within the node to keep backward
62+
* compatibility, then if reg doesn't exist look at the parent node
63+
*/
6064
reg = of_iomap(np, 0);
6165
if (!reg) {
62-
pr_err("%s: Failed to get base address\n", __func__);
63-
return;
66+
reg = of_iomap(of_get_parent(np), 0);
67+
if (!reg) {
68+
pr_err("%s: Failed to get base address\n", __func__);
69+
return;
70+
}
6471
}
6572

6673
parents = clkgen_mux_get_parents(np, &num_parents);

0 commit comments

Comments
 (0)