diff options
author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2016-09-29 10:28:55 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-10-17 18:31:49 -0400 |
commit | 981e1bea55e56abdb16505502e4a69ff868e87d3 (patch) | |
tree | 46b022783dbb1c8c7188d009b466e97689b056a1 | |
parent | 339e1e54891c339b30023c9cc8a005cbf65a3c0c (diff) |
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: Gregory CLEMENT <gregory.clement@free-electrons.com>
Fixes: 8ca4746a78ab ("clk: mvebu: Add the peripheral clock driver for Armada 3700")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/mvebu/armada-37xx-periph.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index 45905fc0d75b..d5dfbad4ceab 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c | |||
@@ -305,7 +305,7 @@ static const struct of_device_id armada_3700_periph_clock_of_match[] = { | |||
305 | }; | 305 | }; |
306 | static int armada_3700_add_composite_clk(const struct clk_periph_data *data, | 306 | static int armada_3700_add_composite_clk(const struct clk_periph_data *data, |
307 | void __iomem *reg, spinlock_t *lock, | 307 | void __iomem *reg, spinlock_t *lock, |
308 | struct device *dev, struct clk_hw *hw) | 308 | struct device *dev, struct clk_hw **hw) |
309 | { | 309 | { |
310 | const struct clk_ops *mux_ops = NULL, *gate_ops = NULL, | 310 | const struct clk_ops *mux_ops = NULL, *gate_ops = NULL, |
311 | *rate_ops = NULL; | 311 | *rate_ops = NULL; |
@@ -353,13 +353,13 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data, | |||
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
356 | hw = clk_hw_register_composite(dev, data->name, data->parent_names, | 356 | *hw = clk_hw_register_composite(dev, data->name, data->parent_names, |
357 | data->num_parents, mux_hw, | 357 | data->num_parents, mux_hw, |
358 | mux_ops, rate_hw, rate_ops, | 358 | mux_ops, rate_hw, rate_ops, |
359 | gate_hw, gate_ops, CLK_IGNORE_UNUSED); | 359 | gate_hw, gate_ops, CLK_IGNORE_UNUSED); |
360 | 360 | ||
361 | if (IS_ERR(hw)) | 361 | if (IS_ERR(*hw)) |
362 | return PTR_ERR(hw); | 362 | return PTR_ERR(*hw); |
363 | 363 | ||
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
@@ -400,7 +400,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev) | |||
400 | spin_lock_init(&driver_data->lock); | 400 | spin_lock_init(&driver_data->lock); |
401 | 401 | ||
402 | for (i = 0; i < num_periph; i++) { | 402 | for (i = 0; i < num_periph; i++) { |
403 | struct clk_hw *hw = driver_data->hw_data->hws[i]; | 403 | struct clk_hw **hw = &driver_data->hw_data->hws[i]; |
404 | 404 | ||
405 | if (armada_3700_add_composite_clk(&data[i], reg, | 405 | if (armada_3700_add_composite_clk(&data[i], reg, |
406 | &driver_data->lock, dev, hw)) | 406 | &driver_data->lock, dev, hw)) |