diff mbox

[10/18] ARM: tegra1: cpuidle: use init/exit common routine

Message ID 1365603743-5618-11-git-send-email-daniel.lezcano@linaro.org
State Superseded
Headers show

Commit Message

Daniel Lezcano April 10, 2013, 2:22 p.m. UTC
Remove the duplicated code and use the cpuidle common code for initialization.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/mach-tegra/cpuidle-tegra114.c |   26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

Comments

Stephen Warren April 10, 2013, 5:29 p.m. UTC | #1
On 04/10/2013 08:22 AM, Daniel Lezcano wrote:
> Subject: ARM: tegra1: cpuidle: use init/exit common routine

The tag there should be just ARM: tegra: - Tegra1 isn't something that's
supported upstream. Same comment for the other two Tegra patches.

> Remove the duplicated code and use the cpuidle common code for initialization.

Other than that, the 3 Tegra patches look reasonable assuming the
patches that implement the new common APIs are accepted, so the 3 Tegra
patches,

Acked-by: Stephen Warren <swarren@nvidia.com>
Daniel Lezcano April 10, 2013, 6:05 p.m. UTC | #2
On 04/10/2013 07:29 PM, Stephen Warren wrote:
> On 04/10/2013 08:22 AM, Daniel Lezcano wrote:
>> Subject: ARM: tegra1: cpuidle: use init/exit common routine
> 
> The tag there should be just ARM: tegra: - Tegra1 isn't something that's
> supported upstream. Same comment for the other two Tegra patches.

Ok.

>> Remove the duplicated code and use the cpuidle common code for initialization.
> 
> Other than that, the 3 Tegra patches look reasonable assuming the
> patches that implement the new common APIs are accepted, so the 3 Tegra
> patches,
> 
> Acked-by: Stephen Warren <swarren@nvidia.com>

Thanks for review

  -- Daniel
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c
index c5fadf9..1d1c602 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra114.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra114.c
@@ -29,31 +29,7 @@  static struct cpuidle_driver tegra_idle_driver = {
 	},
 };
 
-static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
-
 int __init tegra114_cpuidle_init(void)
 {
-	int ret;
-	unsigned int cpu;
-	struct cpuidle_device *dev;
-	struct cpuidle_driver *drv = &tegra_idle_driver;
-
-	ret = cpuidle_register_driver(&tegra_idle_driver);
-	if (ret) {
-		pr_err("CPUidle driver registration failed\n");
-		return ret;
-	}
-
-	for_each_possible_cpu(cpu) {
-		dev = &per_cpu(tegra_idle_device, cpu);
-		dev->cpu = cpu;
-
-		ret = cpuidle_register_device(dev);
-		if (ret) {
-			pr_err("CPU%u: CPUidle device registration failed\n",
-				cpu);
-			return ret;
-		}
-	}
-	return 0;
+	return cpuidle_register(&tegra_idle_driver, NULL);
 }