From: josephl@nvidia.com (Joseph Lo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func
Date: Tue, 4 Jun 2013 18:47:34 +0800 [thread overview]
Message-ID: <1370342855-32705-4-git-send-email-josephl@nvidia.com> (raw)
In-Reply-To: <1370342855-32705-1-git-send-email-josephl@nvidia.com>
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>
---
V2:
* fix the coding style of the runtime chip selection
---
arch/arm/mach-tegra/cpuidle.c | 11 ++++++-----
arch/arm/mach-tegra/cpuidle.h | 17 +----------------
2 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 4a7a788..e85973c 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -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;
}
}
diff --git a/arch/arm/mach-tegra/cpuidle.h b/arch/arm/mach-tegra/cpuidle.h
index 9bcf61f..9ec2c1a 100644
--- a/arch/arm/mach-tegra/cpuidle.h
+++ b/arch/arm/mach-tegra/cpuidle.h
@@ -17,25 +17,10 @@
#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) {}
--
1.8.3
next prev parent reply other threads:[~2013-06-04 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 10:47 [PATCH V2 0/4] ARM: tegra: cpuidle: some clean up for CPUidle driver Joseph Lo
2013-06-04 10:47 ` [PATCH V2 1/4] ARM: tegra: cpuidle: move the init function behind the suspend init function Joseph Lo
2013-06-04 10:47 ` [PATCH V2 2/4] ARM: tegra: hook tegra_tear_down_cpu function in the PM " Joseph Lo
2013-06-04 10:47 ` Joseph Lo [this message]
2013-06-04 10:47 ` [PATCH V2 4/4] ARM: tegra: don't pass CPU ID to tegra_{set, clear}_cpu_in_lp2 Joseph Lo
2013-06-05 17:53 ` [PATCH V2 0/4] ARM: tegra: cpuidle: some clean up for CPUidle driver Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370342855-32705-4-git-send-email-josephl@nvidia.com \
--to=josephl@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).