From patchwork Wed Apr 10 14:22:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2421881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id CB81A3FD8C for ; Wed, 10 Apr 2013 14:30:25 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPvzq-0001Le-Pa; Wed, 10 Apr 2013 14:27:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPvxY-0006dq-Io; Wed, 10 Apr 2013 14:25:12 +0000 Received: from mail-wg0-f51.google.com ([74.125.82.51]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPvvg-0006SE-VF for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2013 14:23:22 +0000 Received: by mail-wg0-f51.google.com with SMTP id b12so551591wgh.30 for ; Wed, 10 Apr 2013 07:23:15 -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=f28AdFcHUBxv6hhudtxf2WCNJM3BMBhzXNGCXE7HeyQ=; b=O79XfWpWWJxVP88kuGHiwG6c865ewe5gJNE1KQVhIN6Yai5z8NRqIcIaaTd5Oad8ae xd0QMSHZEj+v5RDxSDQEW9YUNeh5OapONydj3YNSeleNBemE6R9ZVG5VX/jKSCe1ifnZ 5js3un+iCCKsK8OStDIC0izgSVV6C1Vm/gHpu9fdm2PBceWoFS8dm9dVHzcmjchDSIE0 QhtTdyQVLI41ee0Q6sMnoBtFHjmEI16nV8b6flTv+GmZ4AtEwZzyOnCgovaYqfpEmIfZ tSms1bQa+68nbP6uB11q1Co/z/q+/5AAjimMTkNlDJ74gtDYTixFBLNGAIYPbY8VoM9i 6Qyg== X-Received: by 10.181.11.196 with SMTP id ek4mr3807977wid.30.1365603791674; Wed, 10 Apr 2013 07:23:11 -0700 (PDT) Received: from mai.home (AToulouse-654-1-413-119.w82-125.abo.wanadoo.fr. [82.125.160.119]) by mx.google.com with ESMTPS id dp5sm32126938wib.1.2013.04.10.07.23.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:10 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Subject: [PATCH 14/18] ARM: tegra3: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:19 +0200 Message-Id: <1365603743-5618-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365603743-5618-1-git-send-email-daniel.lezcano@linaro.org> References: <1365603743-5618-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlLn9SxqNDiBTf7W9JRQQKwIN7R/33E1aeMiooaE8XSNVcmwuqm+QQEKf0/1cD6JeygpeJN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130410_102317_550854_587114A9 X-CRM114-Status: GOOD ( 12.29 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.51 listed in list.dnswl.org] 1.7 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: andrew@lunn.ch, khilman@deeprootsystems.com, linus.walleij@linaro.org, nsekhar@ti.com, josephl@nvidia.com, kgene.kim@samsung.com, patches@linaro.org, magnus.damm@gmail.com, tony@atomide.com, plagnioj@jcrosoft.com, linaro-kernel@lists.linaro.org, jason@lakedaemon.net, swarren@wwwdotorg.org, nicolas.ferre@atmel.com, rob.herring@calxeda.com, horms@verge.net.au, linux@maxim.org.za, linux-arm-kernel@lists.infradead.org, deepthi@linux.vnet.ibm.com, jkosina@suse.cz, linux-pm@vger.kernel.org, lethal@linux-sh.org, santosh.shilimkar@ti.com, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Remove the duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano --- 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); }