diff options
author | Jerome Brunet <jbrunet@baylibre.com> | 2018-12-21 17:02:36 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-05 22:33:16 +0200 |
commit | c8e4f8406842332fb55cd792016e5dac266f6354 (patch) | |
tree | 5ddb7e4b5f07b3e26ccef54ec0bddfd97308be4d /drivers/clk | |
parent | 6251c1db04f2ac1ef799763da0f2fa1821dde403 (diff) | |
download | linux-stable-c8e4f8406842332fb55cd792016e5dac266f6354.tar.gz linux-stable-c8e4f8406842332fb55cd792016e5dac266f6354.tar.bz2 linux-stable-c8e4f8406842332fb55cd792016e5dac266f6354.zip |
clk: meson: clean-up clock registration
[ Upstream commit 8d9981efbcab066d17af4d3c85c169200f6f78df ]
Order, ids and size between the table of regmap clocks and the onecell
data table could be different.
Set regmap pointer in all the regmap clocks before starting the
registration using the onecell data, to make sure we don't
get into an incoherent situation.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20181221160239.26265-3-jbrunet@baylibre.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/meson/meson-aoclk.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/clk/meson/meson-aoclk.c b/drivers/clk/meson/meson-aoclk.c index f965845917e3..258c8d259ea1 100644 --- a/drivers/clk/meson/meson-aoclk.c +++ b/drivers/clk/meson/meson-aoclk.c @@ -65,15 +65,20 @@ int meson_aoclkc_probe(struct platform_device *pdev) return ret; } - /* - * Populate regmap and register all clks - */ - for (clkid = 0; clkid < data->num_clks; clkid++) { + /* Populate regmap */ + for (clkid = 0; clkid < data->num_clks; clkid++) data->clks[clkid]->map = regmap; + /* Register all clks */ + for (clkid = 0; clkid < data->hw_data->num; clkid++) { + if (!data->hw_data->hws[clkid]) + continue; + ret = devm_clk_hw_register(dev, data->hw_data->hws[clkid]); - if (ret) + if (ret) { + dev_err(dev, "Clock registration failed\n"); return ret; + } } return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, |