From: Tomeu Vizoso Date: Wed, 17 Sep 2014 09:34:17 +0000 (+0200) Subject: clk: tegra: Make clock initialization more robust X-Git-Tag: firefly_0821_release~176^2~3030^2~16^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9e742c3164344fece3615aca42ec51b41753908;p=firefly-linux-kernel-4.4.55.git 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 Reviewed-by: Stephen Warren --- 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, for (; tbl->clk_id < clk_max; tbl++) { clk = clks[tbl->clk_id]; - if (IS_ERR_OR_NULL(clk)) - return; + if (IS_ERR_OR_NULL(clk)) { + pr_err("%s: invalid entry %ld in clks array for id %d\n", + __func__, PTR_ERR(clk), tbl->clk_id); + WARN_ON(1); + + continue; + } if (tbl->parent_id < clk_max) { struct clk *parent = clks[tbl->parent_id];