diff options
author | Nishanth Menon <nm@ti.com> | 2011-05-25 16:38:47 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-11-08 11:42:17 -0800 |
commit | a820ffa8fdbcaa4f5fe32e88db58acca27abbc76 (patch) | |
tree | c67de9a1f10ac2d122731be51223d4d2a42971aa /drivers/cpufreq | |
parent | 08ca3e3b8ddf0e75f734d46b31518b97256d2c17 (diff) | |
download | linux-a820ffa8fdbcaa4f5fe32e88db58acca27abbc76.tar.gz linux-a820ffa8fdbcaa4f5fe32e88db58acca27abbc76.tar.bz2 linux-a820ffa8fdbcaa4f5fe32e88db58acca27abbc76.zip |
cpufreq: OMAP: deny initialization if no mpudev
if we do not have mpu_dev we normally fail in cpu_init. It is better
to fail driver registration if the devices are not available.
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index 3651825e7fb9..dda32fd0343e 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -50,6 +50,7 @@ static struct lpj_info global_lpj_ref; static struct cpufreq_frequency_table *freq_table; static struct clk *mpu_clk; static char *mpu_clk_name; +static struct device *mpu_dev; static int omap_verify_speed(struct cpufreq_policy *policy) { @@ -152,7 +153,6 @@ static int omap_target(struct cpufreq_policy *policy, static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) { int result = 0; - struct device *mpu_dev; mpu_clk = clk_get(NULL, mpu_clk_name); if (IS_ERR(mpu_clk)) @@ -162,12 +162,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) return -EINVAL; policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu); - mpu_dev = omap2_get_mpuss_device(); - - if (!mpu_dev) { - pr_warning("%s: unable to get the mpu device\n", __func__); - return -EINVAL; - } opp_init_cpufreq_table(mpu_dev, &freq_table); if (freq_table) { @@ -239,6 +233,13 @@ static int __init omap_cpufreq_init(void) pr_err("%s: unsupported Silicon?\n", __func__); return -EINVAL; } + + mpu_dev = omap2_get_mpuss_device(); + if (!mpu_dev) { + pr_warning("%s: unable to get the mpu device\n", __func__); + return -EINVAL; + } + return cpufreq_register_driver(&omap_driver); } |