mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									8ce6f9de97
								
							
						
					
					
						commit
						a307a1e6bc
					
				
					 3 changed files with 5 additions and 19 deletions
				
			
		| 
						 | 
					@ -479,10 +479,8 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)
 | 
				
			||||||
	/* Datasheet says PLL stabalisation time must be at least 300us,
 | 
						/* Datasheet says PLL stabalisation time must be at least 300us,
 | 
				
			||||||
	 * so but add some fudge. (reference in LOCKCON0 register description)
 | 
						 * so but add some fudge. (reference in LOCKCON0 register description)
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	policy->cpuinfo.transition_latency = (500 * 1000) +
 | 
						ret = cpufreq_generic_init(policy, s3c_freq->freq_table,
 | 
				
			||||||
					     s3c_freq->regulator_latency;
 | 
								(500 * 1000) + s3c_freq->regulator_latency);
 | 
				
			||||||
 | 
					 | 
				
			||||||
	ret = cpufreq_table_validate_and_show(policy, s3c_freq->freq_table);
 | 
					 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		goto err_freq_table;
 | 
							goto err_freq_table;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -373,18 +373,7 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 | 
					static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO "%s: initialising policy %p\n", __func__, policy);
 | 
						return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency);
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (policy->cpu != 0)
 | 
					 | 
				
			||||||
		return -EINVAL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* feed the latency information from the cpu driver */
 | 
					 | 
				
			||||||
	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (ftab)
 | 
					 | 
				
			||||||
		return cpufreq_table_validate_and_show(policy, ftab);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int __init s3c_cpufreq_initclks(void)
 | 
					static int __init s3c_cpufreq_initclks(void)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -239,9 +239,8 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
 | 
				
			||||||
	 * the PLLs, which we don't currently) is ~300us worst case,
 | 
						 * the PLLs, which we don't currently) is ~300us worst case,
 | 
				
			||||||
	 * but add some fudge.
 | 
						 * but add some fudge.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;
 | 
						ret = cpufreq_generic_init(policy, s3c64xx_freq_table,
 | 
				
			||||||
 | 
								(500 * 1000) + regulator_latency);
 | 
				
			||||||
	ret = cpufreq_table_validate_and_show(policy, s3c64xx_freq_table);
 | 
					 | 
				
			||||||
	if (ret != 0) {
 | 
						if (ret != 0) {
 | 
				
			||||||
		pr_err("Failed to configure frequency table: %d\n",
 | 
							pr_err("Failed to configure frequency table: %d\n",
 | 
				
			||||||
		       ret);
 | 
							       ret);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue