提交 b9e742c3 编写于 作者: T Tomeu Vizoso 提交者: Peter De Schrijver

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: NTomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
上级 4c495c20
...@@ -207,8 +207,13 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl, ...@@ -207,8 +207,13 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
for (; tbl->clk_id < clk_max; tbl++) { for (; tbl->clk_id < clk_max; tbl++) {
clk = clks[tbl->clk_id]; clk = clks[tbl->clk_id];
if (IS_ERR_OR_NULL(clk)) if (IS_ERR_OR_NULL(clk)) {
return; 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) { if (tbl->parent_id < clk_max) {
struct clk *parent = clks[tbl->parent_id]; struct clk *parent = clks[tbl->parent_id];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册