From patchwork Thu Apr 11 20:42:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2431131 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C81B7DF230 for ; Thu, 11 Apr 2013 20:43:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422651Ab3DKUnh (ORCPT ); Thu, 11 Apr 2013 16:43:37 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:61981 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422652Ab3DKUne (ORCPT ); Thu, 11 Apr 2013 16:43:34 -0400 Received: by mail-wg0-f46.google.com with SMTP id j13so2048579wgh.25 for ; Thu, 11 Apr 2013 13:43:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=y58kHajw97vzuWEpzhyEiOfYxG4CpOc2/P7Zwlkd5Xw=; b=UtPcNNR9BaedDtppRA6lYHufE5CqGp+nkIZyEHsRynlBnGEejBCpXw761/Hi1i45+m BFbbRnwUMp2Xzu4LMuWodZS4oecpjSWTR41rWdooaG84EGshkOob3h9AqDZ1GsYRo/a9 qtbTlPxOVe+ZyRGwipfVjC/X2dXCu2z3Rq6S4gsU+5CoNVvp6WYLVH+SNVoumJ6XdHqw efz9Y+qQGqVhF37Ov7hqu9q/3pZKHs7FSXxvyZkWZ6xoIaasHMG4YVnQwmIq1zJuz/Bo +0Ze3ivuGfWAhUhuURtp8q/7gN5R2u+QhWlnC0KAGG14JFO/IIqxgkhGDSfROLy9ihKG 0lBw== X-Received: by 10.180.188.3 with SMTP id fw3mr12760418wic.33.1365713012839; Thu, 11 Apr 2013 13:43:32 -0700 (PDT) Received: from mai.home (AToulouse-654-1-501-244.w83-205.abo.wanadoo.fr. [83.205.84.244]) by mx.google.com with ESMTPS id fv2sm5794029wib.6.2013.04.11.13.43.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Apr 2013 13:43:32 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: linus.walleij@linaro.org, jason@lakedaemon.net, andrew@lunn.ch, kernel@pengutronix.de, swarren@wwwdotorg.org, santosh.shilimkar@ti.com, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, linux@maxim.org.za, rob.herring@calxeda.com, nsekhar@ti.com, horms@verge.net.au, magnus.damm@gmail.com, deepthi@linux.vnet.ibm.com, lethal@linux-sh.org, jkosina@suse.cz, kgene.kim@samsung.com, khilman@deeprootsystems.com, tony@atomide.com, linux-pm@vger.kernel.org, patches@linaro.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, josephl@nvidia.com Subject: [V2 patch 15/19] ARM: tegra: cpuidle: use init/exit common routine for tegra3 Date: Thu, 11 Apr 2013 22:42:45 +0200 Message-Id: <1365712969-7541-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365712969-7541-1-git-send-email-daniel.lezcano@linaro.org> References: <1365712969-7541-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQl0kr8Xhadv1qdgBxzKEmyPFx4tQMPmPyuU7nOuOLiYZ59aALl1M6GVIxlAsU0vRybW+JYI Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano Acked-by: Stephen Warren --- arch/arm/mach-tegra/cpuidle-tegra30.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/arch/arm/mach-tegra/cpuidle-tegra30.c b/arch/arm/mach-tegra/cpuidle-tegra30.c index f6a0c72..36dc2be 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra30.c +++ b/arch/arm/mach-tegra/cpuidle-tegra30.c @@ -64,8 +64,6 @@ static struct cpuidle_driver tegra_idle_driver = { }, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - #ifdef CONFIG_PM_SLEEP static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev, struct cpuidle_driver *drv, @@ -156,31 +154,8 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev, int __init tegra30_cpuidle_init(void) { - int ret; - unsigned int cpu; - struct cpuidle_device *dev; - struct cpuidle_driver *drv = &tegra_idle_driver; - #ifdef CONFIG_PM_SLEEP tegra_tear_down_cpu = tegra30_tear_down_cpu; #endif - - 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); }