]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func
authorJoseph Lo <josephl@nvidia.com>
Tue, 4 Jun 2013 10:47:34 +0000 (18:47 +0800)
committerStephen Warren <swarren@nvidia.com>
Wed, 5 Jun 2013 17:44:54 +0000 (11:44 -0600)
Clean up the Tegra CPUidle init function by using IS_ENABLED for multi
SoCs management in the init function.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/mach-tegra/cpuidle.c
arch/arm/mach-tegra/cpuidle.h

index 4a7a78804118f2d17fb638be5e9e4ba567b95b8c..e85973cef037e02509cb1a774df7285682795806 100644 (file)
@@ -31,15 +31,16 @@ void __init tegra_cpuidle_init(void)
 {
        switch (tegra_chip_id) {
        case TEGRA20:
-               tegra20_cpuidle_init();
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
+                       tegra20_cpuidle_init();
                break;
        case TEGRA30:
-               tegra30_cpuidle_init();
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC))
+                       tegra30_cpuidle_init();
                break;
        case TEGRA114:
-               tegra114_cpuidle_init();
-               break;
-       default:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
+                       tegra114_cpuidle_init();
                break;
        }
 }
index 9bcf61fa38b804153614c627b20d7c425c94800d..9ec2c1ab0fa4c76a390bfc9673ba9436e18983af 100644 (file)
 #ifndef __MACH_TEGRA_CPUIDLE_H
 #define __MACH_TEGRA_CPUIDLE_H
 
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+#ifdef CONFIG_CPU_IDLE
 int tegra20_cpuidle_init(void);
-#else
-static inline int tegra20_cpuidle_init(void) { return -ENODEV; }
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
 int tegra30_cpuidle_init(void);
-#else
-static inline int tegra30_cpuidle_init(void) { return -ENODEV; }
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_114_SOC
 int tegra114_cpuidle_init(void);
-#else
-static inline int tegra114_cpuidle_init(void) { return -ENODEV; }
-#endif
-
-#ifdef CONFIG_CPU_IDLE
 void tegra_cpuidle_init(void);
 #else
 static inline void tegra_cpuidle_init(void) {}