All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] samsung: clock: Modify for the case with the only parent
@ 2012-09-20  6:50 In-Bae Jeong
  2012-09-26 21:45   ` Sylwester Nawrocki
  0 siblings, 1 reply; 3+ messages in thread
From: In-Bae Jeong @ 2012-09-20  6:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: In-Bae Jeong

'camera' clock has the only parent and thus has no reg_src.
It has a parent clock but it prints 'No parent clock specified' message.
This patch is to deal with the case with the only parent clock.
---
 arch/arm/plat-samsung/clock-clksrc.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
index 786a410..c00bd86 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -131,18 +131,19 @@ void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk, bool announce)
 {
 	struct clksrc_sources *srcs = clk->sources;
 	u32 mask = bit_mask(clk->reg_src.shift, clk->reg_src.size);
-	u32 clksrc;
+	u32 clksrc = 0;
 
-	if (!clk->reg_src.reg) {
-		if (!clk->clk.parent)
-			printk(KERN_ERR "%s: no parent clock specified\n",
-				clk->clk.name);
+	if (!clk->reg_src.reg && !clk->clk.parent && !srcs->nr_sources) {
+		printk(KERN_ERR "%s: no parent clock specified\n",
+		       clk->clk.name);
 		return;
 	}
 
-	clksrc = __raw_readl(clk->reg_src.reg);
-	clksrc &= mask;
-	clksrc >>= clk->reg_src.shift;
+	if (srcs->nr_sources > 1) {
+		clksrc = __raw_readl(clk->reg_src.reg);
+		clksrc &= mask;
+		clksrc >>= clk->reg_src.shift;
+	}
 
 	if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) {
 		printk(KERN_ERR "%s: bad source %d\n",
-- 
1.7.8.6

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

end of thread, other threads:[~2012-09-26 21:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20  6:50 [PATCH] samsung: clock: Modify for the case with the only parent In-Bae Jeong
2012-09-26 21:45 ` Sylwester Nawrocki
2012-09-26 21:45   ` Sylwester Nawrocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.