public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: ux500: clk-sysctrl: handle clocks with no parents
@ 2013-04-30 12:45 Fabio Baltieri
  2013-05-03  8:51 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Baltieri @ 2013-04-30 12:45 UTC (permalink / raw)
  To: Mike Turquette, Ulf Hansson
  Cc: linux-arm-kernel, linux-kernel, Linus Walleij, Lee Jones,
	Fabio Baltieri

Fix clk_reg_sysctrl() to set main clock registers of new struct
clk_sysctrl even if the registered clock has no parents.

This fixes an issue where "ulpclk" was registered with all clk->reg_*
fields uninitialized, causing a -EINVAL error from clk_prepare().

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
 drivers/clk/ux500/clk-sysctrl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
index bc7e9bd..e364c9d 100644
--- a/drivers/clk/ux500/clk-sysctrl.c
+++ b/drivers/clk/ux500/clk-sysctrl.c
@@ -145,7 +145,13 @@ static struct clk *clk_reg_sysctrl(struct device *dev,
 		return ERR_PTR(-ENOMEM);
 	}
 
-	for (i = 0; i < num_parents; i++) {
+	/* set main clock registers */
+	clk->reg_sel[0] = reg_sel[0];
+	clk->reg_bits[0] = reg_bits[0];
+	clk->reg_mask[0] = reg_mask[0];
+
+	/* handle clocks with more than one parent */
+	for (i = 1; i < num_parents; i++) {
 		clk->reg_sel[i] = reg_sel[i];
 		clk->reg_bits[i] = reg_bits[i];
 		clk->reg_mask[i] = reg_mask[i];
-- 
1.8.2


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

end of thread, other threads:[~2013-05-14 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-30 12:45 [PATCH] clk: ux500: clk-sysctrl: handle clocks with no parents Fabio Baltieri
2013-05-03  8:51 ` Ulf Hansson
2013-05-03  8:54   ` Ulf Hansson
2013-05-03  9:03     ` Fabio Baltieri
2013-05-14 19:06       ` Mike Turquette

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