mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 02:21:36 +00:00
ARM: S3C64XX: Avoid announcing clksrc clocks twice
The new code calls the clock setup code on registration which can be before the clock system has been fully initialised. The following code re-does this setup at the end of the clock registration and thus we get two printings. Update the calls to only print on the last pass or when doing the necessary resume work. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
This commit is contained in:
parent
f3e0b724cc
commit
682e2b7d45
@ -486,10 +486,10 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
|
||||
clk_f.rate = fclk;
|
||||
|
||||
for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
|
||||
s3c_set_clksrc(init_parents[ptr]);
|
||||
s3c_set_clksrc(init_parents[ptr], true);
|
||||
|
||||
for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
|
||||
s3c_set_clksrc(&clksrcs[ptr]);
|
||||
s3c_set_clksrc(&clksrcs[ptr], true);
|
||||
}
|
||||
|
||||
static struct clk *clks[] __initdata = {
|
||||
|
@ -125,7 +125,7 @@ static unsigned long s3c_roundrate_clksrc(struct clk *clk,
|
||||
|
||||
/* Clock initialisation code */
|
||||
|
||||
void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk)
|
||||
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);
|
||||
@ -145,9 +145,10 @@ void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk)
|
||||
|
||||
clk->clk.parent = srcs->sources[clksrc];
|
||||
|
||||
printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",
|
||||
clk->clk.name, clk->clk.parent->name, clksrc,
|
||||
clk_get_rate(&clk->clk));
|
||||
if (announce)
|
||||
printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",
|
||||
clk->clk.name, clk->clk.parent->name, clksrc,
|
||||
clk_get_rate(&clk->clk));
|
||||
}
|
||||
|
||||
static struct clk_ops clksrc_ops = {
|
||||
@ -166,7 +167,12 @@ void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
|
||||
if (!clksrc->clk.ops)
|
||||
clksrc->clk.ops = &clksrc_ops;
|
||||
|
||||
s3c_set_clksrc(clksrc);
|
||||
/* setup the clocksource, but do not announce it
|
||||
* as it may be re-set by the setup routines
|
||||
* called after the rest of the clocks have been
|
||||
* registered
|
||||
*/
|
||||
s3c_set_clksrc(clksrc, false);
|
||||
|
||||
ret = s3c24xx_register_clock(&clksrc->clk);
|
||||
|
||||
|
@ -63,7 +63,15 @@ struct clksrc_clk {
|
||||
struct clksrc_reg reg_div;
|
||||
};
|
||||
|
||||
extern void s3c_set_clksrc(struct clksrc_clk *clk);
|
||||
/**
|
||||
* s3c_set_clksrc() - setup the clock from the register settings
|
||||
* @clk: The clock to setup.
|
||||
* @announce: true to announce the setting to printk().
|
||||
*
|
||||
* Setup the clock from the current register settings, for when the
|
||||
* kernel boots or if it is resuming from a possibly unknown state.
|
||||
*/
|
||||
extern void s3c_set_clksrc(struct clksrc_clk *clk, bool announce);
|
||||
|
||||
/**
|
||||
* s3c_register_clksrc() register clocks from an array of clksrc clocks
|
||||
|
Loading…
Reference in New Issue
Block a user