@@ -115,12 +115,12 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
- hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_osc_hw);
+ hw = at91_clk_register_rm9200_main(regmap, "mainck", main_osc_hw);
if (IS_ERR(hw))
goto err_free;
@@ -369,12 +369,12 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw);
+ hw = at91_clk_register_rm9200_main(regmap, "mainck", hw);
if (IS_ERR(hw))
goto err_free;
@@ -130,12 +130,12 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw);
+ hw = at91_clk_register_rm9200_main(regmap, "mainck", hw);
if (IS_ERR(hw))
goto err_free;
@@ -154,14 +154,14 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
@@ -98,7 +98,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
if (!at91sam9rl_pmc)
return;
- hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_xtal_hw);
+ hw = at91_clk_register_rm9200_main(regmap, "mainck", main_xtal_hw);
if (IS_ERR(hw))
goto err_free;
@@ -176,14 +176,14 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
@@ -151,7 +151,6 @@ static const struct clk_ops main_osc_ops = {
struct clk_hw * __init
at91_clk_register_main_osc(struct regmap *regmap,
const char *name,
- const char *parent_name,
struct clk_parent_data *parent_data,
bool bypass)
{
@@ -160,7 +159,7 @@ at91_clk_register_main_osc(struct regmap *regmap,
struct clk_hw *hw;
int ret;
- if (!name || !(parent_name || parent_data))
+ if (!name || !parent_data)
return ERR_PTR(-EINVAL);
osc = kzalloc(sizeof(*osc), GFP_KERNEL);
@@ -169,10 +168,7 @@ at91_clk_register_main_osc(struct regmap *regmap,
init.name = name;
init.ops = &main_osc_ops;
- if (parent_data)
- init.parent_data = (const struct clk_parent_data *)parent_data;
- else
- init.parent_names = &parent_name;
+ init.parent_data = (const struct clk_parent_data *)parent_data;
init.num_parents = 1;
init.flags = CLK_IGNORE_UNUSED;
@@ -401,7 +397,6 @@ static const struct clk_ops rm9200_main_ops = {
struct clk_hw * __init
at91_clk_register_rm9200_main(struct regmap *regmap,
const char *name,
- const char *parent_name,
struct clk_hw *parent_hw)
{
struct clk_rm9200_main *clkmain;
@@ -412,7 +407,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap,
if (!name)
return ERR_PTR(-EINVAL);
- if (!(parent_name || parent_hw))
+ if (!parent_hw)
return ERR_PTR(-EINVAL);
clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL);
@@ -421,10 +416,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap,
init.name = name;
init.ops = &rm9200_main_ops;
- if (parent_hw)
- init.parent_hws = (const struct clk_hw **)&parent_hw;
- else
- init.parent_names = &parent_name;
+ init.parent_hws = (const struct clk_hw **)&parent_hw;
init.num_parents = 1;
init.flags = 0;
@@ -551,7 +543,6 @@ static const struct clk_ops sam9x5_main_ops = {
struct clk_hw * __init
at91_clk_register_sam9x5_main(struct regmap *regmap,
const char *name,
- const char **parent_names,
struct clk_hw **parent_hws,
int num_parents)
{
@@ -564,7 +555,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap,
if (!name)
return ERR_PTR(-EINVAL);
- if (!(parent_hws || parent_names) || !num_parents)
+ if (!parent_hws || !num_parents)
return ERR_PTR(-EINVAL);
clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL);
@@ -573,10 +564,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap,
init.name = name;
init.ops = &sam9x5_main_ops;
- if (parent_hws)
- init.parent_hws = (const struct clk_hw **)parent_hws;
- else
- init.parent_names = parent_names;
+ init.parent_hws = (const struct clk_hw **)parent_hws;
init.num_parents = num_parents;
init.flags = CLK_SET_PARENT_GATE;
@@ -314,7 +314,7 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np)
parent_data.name = parent_name;
parent_data.fw_name = parent_name;
- hw = at91_clk_register_main_osc(regmap, name, NULL, &parent_data, bypass);
+ hw = at91_clk_register_main_osc(regmap, name, &parent_data, bypass);
if (IS_ERR(hw))
return;
@@ -375,7 +375,7 @@ static void __init of_at91rm9200_clk_main_setup(struct device_node *np)
if (!parent_hw)
return;
- hw = at91_clk_register_rm9200_main(regmap, name, NULL, parent_hw);
+ hw = at91_clk_register_rm9200_main(regmap, name, parent_hw);
if (IS_ERR(hw))
return;
@@ -414,8 +414,7 @@ static void __init of_at91sam9x5_clk_main_setup(struct device_node *np)
of_property_read_string(np, "clock-output-names", &name);
- hw = at91_clk_register_sam9x5_main(regmap, name, NULL, parent_hws,
- num_parents);
+ hw = at91_clk_register_sam9x5_main(regmap, name, parent_hws, num_parents);
if (IS_ERR(hw))
return;
@@ -160,16 +160,13 @@ at91_clk_register_main_rc_osc(struct regmap *regmap, const char *name,
u32 frequency, u32 accuracy);
struct clk_hw * __init
at91_clk_register_main_osc(struct regmap *regmap, const char *name,
- const char *parent_name,
struct clk_parent_data *parent_data, bool bypass);
struct clk_hw * __init
at91_clk_register_rm9200_main(struct regmap *regmap,
const char *name,
- const char *parent_name,
struct clk_hw *parent_hw);
struct clk_hw * __init
at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name,
- const char **parent_names,
struct clk_hw **parent_hws, int num_parents);
struct clk_hw * __init
@@ -225,14 +225,13 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL,
- &parent_data, 0);
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, 0);
if (IS_ERR(hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
@@ -209,14 +209,14 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
@@ -157,14 +157,14 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(mainck_hw))
goto err_free;
@@ -172,14 +172,14 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data,
bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
@@ -1037,14 +1037,14 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
parent_data.name = main_xtal_name;
parent_data.fw_name = main_xtal_name;
- main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL,
+ main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc",
&parent_data, bypass);
if (IS_ERR(main_osc_hw))
goto err_free;
parent_hws[0] = main_rc_hw;
parent_hws[1] = main_osc_hw;
- hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2);
+ hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2);
if (IS_ERR(hw))
goto err_free;
Remove parent_names support as parent_hw support is now available on all platforms using clk-main driver. Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 4 ++-- drivers/clk/at91/at91sam9g45.c | 4 ++-- drivers/clk/at91/at91sam9n12.c | 4 ++-- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-main.c | 24 ++++++------------------ drivers/clk/at91/dt-compat.c | 7 +++---- drivers/clk/at91/pmc.h | 3 --- drivers/clk/at91/sam9x60.c | 5 ++--- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 4 ++-- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 4 ++-- 14 files changed, 30 insertions(+), 47 deletions(-)