Commit 3379a37a authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

cpufreq: s3c24xx: Fix broken s3c_cpufreq_init()

commit 0373ca74 upstream.

commit a307a1e6 "cpufreq: s3c: use cpufreq_generic_init()"
accidentally broke cpufreq on s3c2410 and s3c2412.

These two platforms don't have a CPU frequency table and used to skip
calling cpufreq_table_validate_and_show() for them.  But with the
above commit, we started calling it unconditionally and that will
eventually fail as the frequency table pointer is NULL.

Fix this by calling cpufreq_table_validate_and_show() conditionally

Fixes: a307a1e6 "cpufreq: s3c: use cpufreq_generic_init()"
Cc: 3.13+ <> # v3.13+
Signed-off-by: default avatarViresh Kumar <>
Signed-off-by: default avatarRafael J. Wysocki <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent d5168ce3
......@@ -351,7 +351,13 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
static int s3c_cpufreq_init(struct cpufreq_policy *policy)
policy->clk = clk_arm;
return cpufreq_generic_init(policy, ftab,>latency);
policy->cpuinfo.transition_latency =>latency;
if (ftab)
return cpufreq_table_validate_and_show(policy, ftab);
return 0;
static int __init s3c_cpufreq_initclks(void)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment