aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-05-25 19:38:47 -0400
committerKevin Hilman <khilman@ti.com>2011-11-08 14:42:17 -0500
commita820ffa8fdbcaa4f5fe32e88db58acca27abbc76 (patch)
treec67de9a1f10ac2d122731be51223d4d2a42971aa /drivers
parent08ca3e3b8ddf0e75f734d46b31518b97256d2c17 (diff)
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')
-rw-r--r--drivers/cpufreq/omap-cpufreq.c15
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;
50static struct cpufreq_frequency_table *freq_table; 50static struct cpufreq_frequency_table *freq_table;
51static struct clk *mpu_clk; 51static struct clk *mpu_clk;
52static char *mpu_clk_name; 52static char *mpu_clk_name;
53static struct device *mpu_dev;
53 54
54static int omap_verify_speed(struct cpufreq_policy *policy) 55static int omap_verify_speed(struct cpufreq_policy *policy)
55{ 56{
@@ -152,7 +153,6 @@ static int omap_target(struct cpufreq_policy *policy,
152static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) 153static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
153{ 154{
154 int result = 0; 155 int result = 0;
155 struct device *mpu_dev;
156 156
157 mpu_clk = clk_get(NULL, mpu_clk_name); 157 mpu_clk = clk_get(NULL, mpu_clk_name);
158 if (IS_ERR(mpu_clk)) 158 if (IS_ERR(mpu_clk))
@@ -162,12 +162,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
162 return -EINVAL; 162 return -EINVAL;
163 163
164 policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu); 164 policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
165 mpu_dev = omap2_get_mpuss_device();
166
167 if (!mpu_dev) {
168 pr_warning("%s: unable to get the mpu device\n", __func__);
169 return -EINVAL;
170 }
171 opp_init_cpufreq_table(mpu_dev, &freq_table); 165 opp_init_cpufreq_table(mpu_dev, &freq_table);
172 166
173 if (freq_table) { 167 if (freq_table) {
@@ -239,6 +233,13 @@ static int __init omap_cpufreq_init(void)
239 pr_err("%s: unsupported Silicon?\n", __func__); 233 pr_err("%s: unsupported Silicon?\n", __func__);
240 return -EINVAL; 234 return -EINVAL;
241 } 235 }
236
237 mpu_dev = omap2_get_mpuss_device();
238 if (!mpu_dev) {
239 pr_warning("%s: unable to get the mpu device\n", __func__);
240 return -EINVAL;
241 }
242
242 return cpufreq_register_driver(&omap_driver); 243 return cpufreq_register_driver(&omap_driver);
243} 244}
244 245