All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func
Date: Mon, 3 Jun 2013 19:17:46 +0800	[thread overview]
Message-ID: <1370258267-30184-4-git-send-email-josephl@nvidia.com> (raw)
In-Reply-To: <1370258267-30184-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/mach-tegra/cpuidle.c | 13 +++----------
 arch/arm/mach-tegra/cpuidle.h | 17 +----------------
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 4a7a788..55e88c8 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -29,17 +29,10 @@
 
 void __init tegra_cpuidle_init(void)
 {
-	switch (tegra_chip_id) {
-	case TEGRA20:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
 		tegra20_cpuidle_init();
-		break;
-	case TEGRA30:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
 		tegra30_cpuidle_init();
-		break;
-	case TEGRA114:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
 		tegra114_cpuidle_init();
-		break;
-	default:
-		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

WARNING: multiple messages have this Message-ID (diff)
From: josephl@nvidia.com (Joseph Lo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func
Date: Mon, 3 Jun 2013 19:17:46 +0800	[thread overview]
Message-ID: <1370258267-30184-4-git-send-email-josephl@nvidia.com> (raw)
In-Reply-To: <1370258267-30184-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>
---
 arch/arm/mach-tegra/cpuidle.c | 13 +++----------
 arch/arm/mach-tegra/cpuidle.h | 17 +----------------
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 4a7a788..55e88c8 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -29,17 +29,10 @@
 
 void __init tegra_cpuidle_init(void)
 {
-	switch (tegra_chip_id) {
-	case TEGRA20:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
 		tegra20_cpuidle_init();
-		break;
-	case TEGRA30:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
 		tegra30_cpuidle_init();
-		break;
-	case TEGRA114:
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
 		tegra114_cpuidle_init();
-		break;
-	default:
-		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

  parent reply	other threads:[~2013-06-03 11:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 11:17 [PATCH 0/4] ARM: tegra: cpuidle: some clean up for CPUidle driver Joseph Lo
2013-06-03 11:17 ` Joseph Lo
     [not found] ` <1370258267-30184-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 11:17   ` [PATCH 1/4] ARM: tegra: cpuidle: move the init function behind the suspend init function Joseph Lo
2013-06-03 11:17     ` Joseph Lo
2013-06-03 11:17   ` [PATCH 2/4] ARM: tegra: hook tegra_tear_down_cpu function in the PM " Joseph Lo
2013-06-03 11:17     ` Joseph Lo
     [not found]     ` <1370258267-30184-3-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 20:31       ` Stephen Warren
2013-06-03 20:31         ` Stephen Warren
2013-06-03 11:17   ` Joseph Lo [this message]
2013-06-03 11:17     ` [PATCH 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func Joseph Lo
2013-06-03 11:17   ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set,clear}_cpu_in_lp2 Joseph Lo
2013-06-03 11:17     ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set, clear}_cpu_in_lp2 Joseph Lo
     [not found]     ` <1370258267-30184-5-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 20:35       ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set,clear}_cpu_in_lp2 Stephen Warren
2013-06-03 20:35         ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set, clear}_cpu_in_lp2 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=1370258267-30184-4-git-send-email-josephl@nvidia.com \
    --to=josephl-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.