aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2014-09-17 05:34:17 -0400
committerPeter De Schrijver <pdeschrijver@nvidia.com>2014-09-18 07:56:53 -0400
commitb9e742c3164344fece3615aca42ec51b41753908 (patch)
treec6d2ec101d61bb69fa6eee437f67e2bed1cee8ab /drivers/clk
parent4c495c204f794125db11e74bd61228901b0acaa7 (diff)
clk: tegra: Make clock initialization more robust
Don't abort clock initialization if we cannot match an entry in tegra_clk_init_table to a valid entry in the clk array. Also log a corresponding error message. This was discovered when testing a patch that removed the EMC clock from tegra124_clks but left a mention in tegra_clk_init_table. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/tegra/clk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index f87c609e8f72..97dc8595c3cd 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -207,8 +207,13 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
207 207
208 for (; tbl->clk_id < clk_max; tbl++) { 208 for (; tbl->clk_id < clk_max; tbl++) {
209 clk = clks[tbl->clk_id]; 209 clk = clks[tbl->clk_id];
210 if (IS_ERR_OR_NULL(clk)) 210 if (IS_ERR_OR_NULL(clk)) {
211 return; 211 pr_err("%s: invalid entry %ld in clks array for id %d\n",
212 __func__, PTR_ERR(clk), tbl->clk_id);
213 WARN_ON(1);
214
215 continue;
216 }
212 217
213 if (tbl->parent_id < clk_max) { 218 if (tbl->parent_id < clk_max) {
214 struct clk *parent = clks[tbl->parent_id]; 219 struct clk *parent = clks[tbl->parent_id];