public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: tegra: Make clock initialization more robust
@ 2014-09-17  9:34 Tomeu Vizoso
  2014-09-17 15:19 ` Stephen Warren
  2014-09-19 11:45 ` Peter De Schrijver
  0 siblings, 2 replies; 3+ messages in thread
From: Tomeu Vizoso @ 2014-09-17  9:34 UTC (permalink / raw)
  To: Mike Turquette
  Cc: Peter De Schrijver, Prashant Gaikwad, Stephen Warren,
	Thierry Reding, linux-kernel, linux-tegra,
	Javier Martinez Canillas, Tomeu Vizoso

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>
---
 drivers/clk/tegra/clk.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index d5963f6..562c911 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -206,8 +206,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_core *parent = clks[tbl->parent_id];
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-19 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-17  9:34 [PATCH] clk: tegra: Make clock initialization more robust Tomeu Vizoso
2014-09-17 15:19 ` Stephen Warren
2014-09-19 11:45 ` Peter De Schrijver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox