]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch
4138e3fe97ec69808ba93bd0ea08aa62c9c80af8
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / cpufreq / 0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch
1 From 85afa12ad2a6e7a23ddf4b25e78e0ce5b9f18a64 Mon Sep 17 00:00:00 2001
2 From: Nishanth Menon <nm@ti.com>
3 Date: Wed, 25 May 2011 16:38:47 -0700
4 Subject: [PATCH 11/19] OMAP2+: cpufreq: deny initialization if no mpudev
6 if we do not have mpu_dev we normally fail in cpu_init. It is better
7 to fail driver registration if the devices are not available.
9 Signed-off-by: Nishanth Menon <nm@ti.com>
10 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11 ---
12  arch/arm/mach-omap2/omap2plus-cpufreq.c |   15 ++++++++-------
13  1 files changed, 8 insertions(+), 7 deletions(-)
15 diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
16 index c46d0cd..33a91ec 100644
17 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
18 +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
19 @@ -43,6 +43,7 @@
20  static struct cpufreq_frequency_table *freq_table;
21  static struct clk *mpu_clk;
22  static char *mpu_clk_name;
23 +static struct device *mpu_dev;
24  
25  static int omap_verify_speed(struct cpufreq_policy *policy)
26  {
27 @@ -155,7 +156,6 @@ skip_lpj:
28  static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
29  {
30         int result = 0;
31 -       struct device *mpu_dev;
32         static cpumask_var_t cpumask;
33  
34         mpu_clk = clk_get(NULL, mpu_clk_name);
35 @@ -166,12 +166,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
36                 return -EINVAL;
37  
38         policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
39 -       mpu_dev = omap2_get_mpuss_device();
40 -
41 -       if (!mpu_dev) {
42 -               pr_warning("%s: unable to get the mpu device\n", __func__);
43 -               return -EINVAL;
44 -       }
45         opp_init_cpufreq_table(mpu_dev, &freq_table);
46  
47         if (freq_table) {
48 @@ -244,6 +238,13 @@ static int __init omap_cpufreq_init(void)
49                 pr_err("%s: unsupported Silicon?\n", __func__);
50                 return -EINVAL;
51         }
52 +
53 +       mpu_dev = omap2_get_mpuss_device();
54 +       if (!mpu_dev) {
55 +               pr_warning("%s: unable to get the mpu device\n", __func__);
56 +               return -EINVAL;
57 +       }
58 +
59         return cpufreq_register_driver(&omap_driver);
60  }
61  
62 -- 
63 1.6.6.1