Commit 981e1bea authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Stephen Boyd

clk: mvebu: armada-37xx-periph: Fix the clock provider registration

While trying using a peripheral clock on a driver, I saw that the clock
pointer returned by the provider was NULL.

The problem was a missing indirection. It was the pointer stored in the
hws array which needed to be updated not the value it contains.
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Fixes: 8ca4746a ("clk: mvebu: Add the peripheral clock driver for Armada 3700")
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 339e1e54
...@@ -305,7 +305,7 @@ static const struct of_device_id armada_3700_periph_clock_of_match[] = { ...@@ -305,7 +305,7 @@ static const struct of_device_id armada_3700_periph_clock_of_match[] = {
}; };
static int armada_3700_add_composite_clk(const struct clk_periph_data *data, static int armada_3700_add_composite_clk(const struct clk_periph_data *data,
void __iomem *reg, spinlock_t *lock, void __iomem *reg, spinlock_t *lock,
struct device *dev, struct clk_hw *hw) struct device *dev, struct clk_hw **hw)
{ {
const struct clk_ops *mux_ops = NULL, *gate_ops = NULL, const struct clk_ops *mux_ops = NULL, *gate_ops = NULL,
*rate_ops = NULL; *rate_ops = NULL;
...@@ -353,13 +353,13 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data, ...@@ -353,13 +353,13 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data,
} }
} }
hw = clk_hw_register_composite(dev, data->name, data->parent_names, *hw = clk_hw_register_composite(dev, data->name, data->parent_names,
data->num_parents, mux_hw, data->num_parents, mux_hw,
mux_ops, rate_hw, rate_ops, mux_ops, rate_hw, rate_ops,
gate_hw, gate_ops, CLK_IGNORE_UNUSED); gate_hw, gate_ops, CLK_IGNORE_UNUSED);
if (IS_ERR(hw)) if (IS_ERR(*hw))
return PTR_ERR(hw); return PTR_ERR(*hw);
return 0; return 0;
} }
...@@ -400,7 +400,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev) ...@@ -400,7 +400,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
spin_lock_init(&driver_data->lock); spin_lock_init(&driver_data->lock);
for (i = 0; i < num_periph; i++) { for (i = 0; i < num_periph; i++) {
struct clk_hw *hw = driver_data->hw_data->hws[i]; struct clk_hw **hw = &driver_data->hw_data->hws[i];
if (armada_3700_add_composite_clk(&data[i], reg, if (armada_3700_add_composite_clk(&data[i], reg,
&driver_data->lock, dev, hw)) &driver_data->lock, dev, hw))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment