Skip to content

Commit

Permalink
clk: tegra: Make clock initialization more robust
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomeu Vizoso authored and Peter De Schrijver committed Sep 18, 2014
1 parent 4c495c2 commit b9e742c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/clk/tegra/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit b9e742c

Please sign in to comment.