@@ -207,7 +207,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
for (i = 0; i < ARRAY_SIZE(at91rm9200_periphck); i++) {
hw = at91_clk_register_peripheral(regmap,
at91rm9200_periphck[i].n,
- NULL, at91rm9200_pmc->chws[PMC_MCK],
+ at91rm9200_pmc->chws[PMC_MCK],
at91rm9200_periphck[i].id);
if (IS_ERR(hw))
goto err_free;
@@ -486,7 +486,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
for (i = 0; i < data->num_pck; i++) {
hw = at91_clk_register_peripheral(regmap,
data->pck[i].n,
- NULL, at91sam9260_pmc->chws[PMC_MCK],
+ at91sam9260_pmc->chws[PMC_MCK],
data->pck[i].id);
if (IS_ERR(hw))
goto err_free;
@@ -225,7 +225,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
for (i = 0; i < ARRAY_SIZE(at91sam9g45_periphck); i++) {
hw = at91_clk_register_peripheral(regmap,
at91sam9g45_periphck[i].n,
- NULL, at91sam9g45_pmc->chws[PMC_MCK],
+ at91sam9g45_pmc->chws[PMC_MCK],
at91sam9g45_periphck[i].id);
if (IS_ERR(hw))
goto err_free;
@@ -254,7 +254,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&at91sam9n12_pcr_layout,
at91sam9n12_periphck[i].n,
- NULL, at91sam9n12_pmc->chws[PMC_MCK],
+ at91sam9n12_pmc->chws[PMC_MCK],
at91sam9n12_periphck[i].id,
&range, INT_MIN, 0);
if (IS_ERR(hw))
@@ -175,7 +175,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
for (i = 0; i < ARRAY_SIZE(at91sam9rl_periphck); i++) {
hw = at91_clk_register_peripheral(regmap,
at91sam9rl_periphck[i].n,
- NULL, at91sam9rl_pmc->chws[PMC_MCK],
+ at91sam9rl_pmc->chws[PMC_MCK],
at91sam9rl_periphck[i].id);
if (IS_ERR(hw))
goto err_free;
@@ -287,7 +287,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&at91sam9x5_pcr_layout,
at91sam9x5_periphck[i].n,
- NULL, at91sam9x5_pmc->chws[PMC_MCK],
+ at91sam9x5_pmc->chws[PMC_MCK],
at91sam9x5_periphck[i].id,
&range, INT_MIN, 0);
if (IS_ERR(hw))
@@ -300,7 +300,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&at91sam9x5_pcr_layout,
extra_pcks[i].n,
- NULL, at91sam9x5_pmc->chws[PMC_MCK],
+ at91sam9x5_pmc->chws[PMC_MCK],
extra_pcks[i].id,
&range, INT_MIN, 0);
if (IS_ERR(hw))
@@ -97,15 +97,14 @@ static const struct clk_ops peripheral_ops = {
struct clk_hw * __init
at91_clk_register_peripheral(struct regmap *regmap, const char *name,
- const char *parent_name, struct clk_hw *parent_hw,
- u32 id)
+ struct clk_hw *parent_hw, u32 id)
{
struct clk_peripheral *periph;
struct clk_init_data init = {};
struct clk_hw *hw;
int ret;
- if (!name || !(parent_name || parent_hw) || id > PERIPHERAL_ID_MAX)
+ if (!name || !parent_hw || id > PERIPHERAL_ID_MAX)
return ERR_PTR(-EINVAL);
periph = kzalloc(sizeof(*periph), GFP_KERNEL);
@@ -114,10 +113,7 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name,
init.name = name;
init.ops = &peripheral_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;
@@ -447,8 +443,7 @@ static const struct clk_ops sam9x5_peripheral_chg_ops = {
struct clk_hw * __init
at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
const struct clk_pcr_layout *layout,
- const char *name, const char *parent_name,
- struct clk_hw *parent_hw,
+ const char *name, struct clk_hw *parent_hw,
u32 id, const struct clk_range *range,
int chg_pid, unsigned long flags)
{
@@ -457,7 +452,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
struct clk_hw *hw;
int ret;
- if (!name || !(parent_name || parent_hw))
+ if (!name || !parent_hw)
return ERR_PTR(-EINVAL);
periph = kzalloc(sizeof(*periph), GFP_KERNEL);
@@ -465,10 +460,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
return ERR_PTR(-ENOMEM);
init.name = name;
- 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 = flags;
if (chg_pid < 0) {
@@ -561,7 +561,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
if (type == PERIPHERAL_AT91RM9200) {
hw = at91_clk_register_peripheral(regmap, name,
- NULL, parent_hw, id);
+ parent_hw, id);
} else {
struct clk_range range = CLK_RANGE(0, 0);
unsigned long flags = 0;
@@ -582,7 +582,6 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
&pmc_pcr_lock,
&dt_pcr_layout,
name,
- NULL,
parent_hw,
id, &range,
INT_MIN,
@@ -192,13 +192,11 @@ at91_clk_sama7g5_register_master(struct regmap *regmap,
struct clk_hw * __init
at91_clk_register_peripheral(struct regmap *regmap, const char *name,
- const char *parent_name, struct clk_hw *parent_hw,
- u32 id);
+ struct clk_hw *parent_hw, u32 id);
struct clk_hw * __init
at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
const struct clk_pcr_layout *layout,
- const char *name, const char *parent_name,
- struct clk_hw *parent_hw,
+ const char *name, struct clk_hw *parent_hw,
u32 id, const struct clk_range *range,
int chg_pid, unsigned long flags);
@@ -348,7 +348,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sam9x60_pcr_layout,
sam9x60_periphck[i].n,
- NULL, sam9x60_pmc->chws[PMC_MCK],
+ sam9x60_pmc->chws[PMC_MCK],
sam9x60_periphck[i].id,
&range, INT_MIN,
sam9x60_periphck[i].flags);
@@ -337,7 +337,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama5d2_pcr_layout,
sama5d2_periphck[i].n,
- NULL, sama5d2_pmc->chws[PMC_MCK],
+ sama5d2_pmc->chws[PMC_MCK],
sama5d2_periphck[i].id,
&range, INT_MIN,
sama5d2_periphck[i].flags);
@@ -351,7 +351,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama5d2_pcr_layout,
sama5d2_periph32ck[i].n,
- NULL, sama5d2_pmc->chws[PMC_MCK2],
+ sama5d2_pmc->chws[PMC_MCK2],
sama5d2_periph32ck[i].id,
&sama5d2_periph32ck[i].r,
INT_MIN, 0);
@@ -259,7 +259,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama5d3_pcr_layout,
sama5d3_periphck[i].n,
- NULL, sama5d3_pmc->chws[PMC_MCK],
+ sama5d3_pmc->chws[PMC_MCK],
sama5d3_periphck[i].id,
&sama5d3_periphck[i].r,
INT_MIN,
@@ -282,7 +282,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama5d4_pcr_layout,
sama5d4_periphck[i].n,
- NULL, sama5d4_pmc->chws[PMC_MCK],
+ sama5d4_pmc->chws[PMC_MCK],
sama5d4_periphck[i].id,
&range, INT_MIN,
sama5d4_periphck[i].flags);
@@ -296,7 +296,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama5d4_pcr_layout,
sama5d4_periph32ck[i].n,
- NULL, sama5d4_pmc->chws[PMC_MCK2],
+ sama5d4_pmc->chws[PMC_MCK2],
sama5d4_periph32ck[i].id,
&range, INT_MIN, 0);
if (IS_ERR(hw))
@@ -1195,7 +1195,6 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sama7g5_pcr_layout,
sama7g5_periphck[i].n,
- NULL,
sama7g5_mckx[sama7g5_periphck[i].p].hw,
sama7g5_periphck[i].id,
&sama7g5_periphck[i].r,
Remove parent_names support as parent_hw support is now available on all platforms using clk-peripheral driver. Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-peripheral.c | 20 ++++++-------------- drivers/clk/at91/dt-compat.c | 3 +-- drivers/clk/at91/pmc.h | 6 ++---- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 1 - 14 files changed, 22 insertions(+), 34 deletions(-)