diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-10-03 10:59:22 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-15 18:50:35 -0400 |
commit | a307a1e6bc0da1ea1e5960fb386b2bbc3587e808 (patch) | |
tree | 1f253f1cddf7897881fb7063f374fecb866a1b78 /drivers/cpufreq | |
parent | 8ce6f9de9785857669d39e061c9d2e87d1c516d7 (diff) |
cpufreq: s3c: use cpufreq_generic_init()
Use generic cpufreq_generic_init() routine instead of replicating the same code
here.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/s3c2416-cpufreq.c | 6 | ||||
-rw-r--r-- | drivers/cpufreq/s3c24xx-cpufreq.c | 13 | ||||
-rw-r--r-- | drivers/cpufreq/s3c64xx-cpufreq.c | 5 |
3 files changed, 5 insertions, 19 deletions
diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c index 22c4c2d837bd..26a35d137157 100644 --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c | |||
@@ -479,10 +479,8 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy) | |||
479 | /* Datasheet says PLL stabalisation time must be at least 300us, | 479 | /* Datasheet says PLL stabalisation time must be at least 300us, |
480 | * so but add some fudge. (reference in LOCKCON0 register description) | 480 | * so but add some fudge. (reference in LOCKCON0 register description) |
481 | */ | 481 | */ |
482 | policy->cpuinfo.transition_latency = (500 * 1000) + | 482 | ret = cpufreq_generic_init(policy, s3c_freq->freq_table, |
483 | s3c_freq->regulator_latency; | 483 | (500 * 1000) + s3c_freq->regulator_latency); |
484 | |||
485 | ret = cpufreq_table_validate_and_show(policy, s3c_freq->freq_table); | ||
486 | if (ret) | 484 | if (ret) |
487 | goto err_freq_table; | 485 | goto err_freq_table; |
488 | 486 | ||
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index e0fbaefc69a7..485088253358 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c | |||
@@ -373,18 +373,7 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name) | |||
373 | 373 | ||
374 | static int s3c_cpufreq_init(struct cpufreq_policy *policy) | 374 | static int s3c_cpufreq_init(struct cpufreq_policy *policy) |
375 | { | 375 | { |
376 | printk(KERN_INFO "%s: initialising policy %p\n", __func__, policy); | 376 | return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency); |
377 | |||
378 | if (policy->cpu != 0) | ||
379 | return -EINVAL; | ||
380 | |||
381 | /* feed the latency information from the cpu driver */ | ||
382 | policy->cpuinfo.transition_latency = cpu_cur.info->latency; | ||
383 | |||
384 | if (ftab) | ||
385 | return cpufreq_table_validate_and_show(policy, ftab); | ||
386 | |||
387 | return 0; | ||
388 | } | 377 | } |
389 | 378 | ||
390 | static int __init s3c_cpufreq_initclks(void) | 379 | static int __init s3c_cpufreq_initclks(void) |
diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index a66cfa3e54a1..16dc315d31e6 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c | |||
@@ -239,9 +239,8 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) | |||
239 | * the PLLs, which we don't currently) is ~300us worst case, | 239 | * the PLLs, which we don't currently) is ~300us worst case, |
240 | * but add some fudge. | 240 | * but add some fudge. |
241 | */ | 241 | */ |
242 | policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency; | 242 | ret = cpufreq_generic_init(policy, s3c64xx_freq_table, |
243 | 243 | (500 * 1000) + regulator_latency); | |
244 | ret = cpufreq_table_validate_and_show(policy, s3c64xx_freq_table); | ||
245 | if (ret != 0) { | 244 | if (ret != 0) { |
246 | pr_err("Failed to configure frequency table: %d\n", | 245 | pr_err("Failed to configure frequency table: %d\n", |
247 | ret); | 246 | ret); |