From patchwork Fri Apr 12 12:36:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16107 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F27926EB0 for ; Fri, 12 Apr 2013 12:37:20 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id p12sf4190836vbe.4 for ; Fri, 12 Apr 2013 05:36:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=Vte6hNYhFqacRrFoWDJfOohwSDJTARbVMp8HH2mM88w=; b=DM1KG2rnxsWr/izhZ/93bXMNkXG12DiEA2UumZmlQZGlxB6vor+1Ccadpx5oEKbaon xP4Z8++vI772KFzBJvwlfD1nRzyYsuzO/v2VgQvX78tY+dbD2PfVRy09PYIDLMj+dO+B JUyBEEUizzRuwiDPmP4go97yyeEw6K7SWR46LZrV0iP0D+b8x+qgbkRmV8h+Jl3S/Cp9 ph3IgGvGXziWr/s71GJkdkSaMvZVigy2+iu7coOn03DPQukBmNrhz9E1wZeSeKSoyFmU SSAPNdqTxySeOMkGqjZftDnwTsHmWC/7XGX7cpN61yT+woiM3DW05qSzHyIBMqLQBqSF s5jQ== X-Received: by 10.224.18.132 with SMTP id w4mr6130243qaa.1.1365770216130; Fri, 12 Apr 2013 05:36:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.42 with SMTP id t10ls1273167qed.35.gmail; Fri, 12 Apr 2013 05:36:56 -0700 (PDT) X-Received: by 10.59.5.226 with SMTP id cp2mr8357295ved.13.1365770215989; Fri, 12 Apr 2013 05:36:55 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id ez9si1944958vdb.146.2013.04.12.05.36.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id m1so2379466ves.27 for ; Fri, 12 Apr 2013 05:36:55 -0700 (PDT) X-Received: by 10.58.84.164 with SMTP id a4mr8348122vez.9.1365770215695; Fri, 12 Apr 2013 05:36:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp64097veb; Fri, 12 Apr 2013 05:36:55 -0700 (PDT) X-Received: by 10.194.60.195 with SMTP id j3mr17196184wjr.33.1365770214537; Fri, 12 Apr 2013 05:36:54 -0700 (PDT) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [2a00:1450:400c:c03::232]) by mx.google.com with ESMTPS id f2si803629wie.47.2013.04.12.05.36.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:54 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::232 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::232; Received: by mail-we0-f178.google.com with SMTP id z53so2094225wey.9 for ; Fri, 12 Apr 2013 05:36:54 -0700 (PDT) X-Received: by 10.180.181.40 with SMTP id dt8mr3784591wic.17.1365770214140; Fri, 12 Apr 2013 05:36:54 -0700 (PDT) Received: from mai.home (AToulouse-654-1-349-85.w90-55.abo.wanadoo.fr. [90.55.188.85]) by mx.google.com with ESMTPS id ej8sm3043646wib.9.2013.04.12.05.36.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:53 -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: [V3 patch 14/19] ARM: tegra: cpuidle: use init/exit common routine for tegra2 Date: Fri, 12 Apr 2013 14:36:00 +0200 Message-Id: <1365770165-27096-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365770165-27096-1-git-send-email-daniel.lezcano@linaro.org> References: <1365770165-27096-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQl0mbgiBh2goXYp54tFRptIIVWEzFYPlXjC0AqIjcjZyXEYKfyUnCh7SXryL6ttB/wyBE7o X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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-tegra20.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c index f1f6ac4..590ec25 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra20.c +++ b/arch/arm/mach-tegra/cpuidle-tegra20.c @@ -70,8 +70,6 @@ static struct cpuidle_driver tegra_idle_driver = { .safe_state_index = 0, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - #ifdef CONFIG_PM_SLEEP #ifdef CONFIG_SMP static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); @@ -220,34 +218,8 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, int __init tegra20_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 = tegra20_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; -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED - dev->coupled_cpus = *cpu_possible_mask; -#endif - - 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, cpu_possible_mask); }