From patchwork Tue Apr 23 08:54:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB7EF2391B for ; Tue, 23 Apr 2013 08:56:04 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id hg5sf331543qab.5 for ; Tue, 23 Apr 2013 01:55:16 -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=P3CGWxXOHizDGS31cwdFzxFI82la/QucC7BII13jjzNOx7gf0YXfsfMQn0dxWnj2pI sU9AJyf1zJ+0PmDTdZ4XH/h7X+jLkGICB2fYbDR0aFDyBrXc3lQyWNE4fORch1fDYRAI xi33cczfwnZ4PVEkTGHJdsj0SE2B9Po4SQlNth+HpBre3MGx4l7M6ognS2Y2zBO0mIU9 tA99MnsLYdtVtNyQIqO5P6NjvyRM2rL5KEC0tFPpvlHeNVuJP2Vb2bnQmKHlkNxEmIdV ZRXZusqa3VxCsZeQbkX6M0pY3ppqyrChEIdDWeT3eaFnZ5HFSnxGhkc6IuWKZddoaZa5 TRew== X-Received: by 10.224.10.6 with SMTP id n6mr18441233qan.4.1366707316438; Tue, 23 Apr 2013 01:55:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.98.166 with SMTP id ej6ls226772qeb.37.gmail; Tue, 23 Apr 2013 01:55:16 -0700 (PDT) X-Received: by 10.58.56.161 with SMTP id b1mr21859462veq.42.1366707316333; Tue, 23 Apr 2013 01:55:16 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id sa4si18016729vdc.88.2013.04.23.01.55.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id d10so129594vea.40 for ; Tue, 23 Apr 2013 01:55:16 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr18435109vdj.75.1366707316183; Tue, 23 Apr 2013 01:55:16 -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 nf2csp114005veb; Tue, 23 Apr 2013 01:55:15 -0700 (PDT) X-Received: by 10.180.92.41 with SMTP id cj9mr26495406wib.7.1366707315261; Tue, 23 Apr 2013 01:55:15 -0700 (PDT) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [2a00:1450:400c:c03::22d]) by mx.google.com with ESMTPS id le5si10323312wjb.219.2013.04.23.01.55.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:15 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22d is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::22d; Received: by mail-we0-f173.google.com with SMTP id o7so341659wea.18 for ; Tue, 23 Apr 2013 01:55:14 -0700 (PDT) X-Received: by 10.180.93.134 with SMTP id cu6mr58073066wib.8.1366707314532; Tue, 23 Apr 2013 01:55:14 -0700 (PDT) Received: from mai.home (AToulouse-654-1-479-219.w86-201.abo.wanadoo.fr. [86.201.194.219]) by mx.google.com with ESMTPS id q13sm27358775wie.8.2013.04.23.01.55.11 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:13 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: andrew@lunn.ch, khilman@deeprootsystems.com, 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, 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, kernel@pengutronix.de Subject: [V4 patch 10/15] ARM: tegra: cpuidle: use init/exit common routine for tegra2 Date: Tue, 23 Apr 2013 10:54:40 +0200 Message-Id: <1366707285-12179-11-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366707285-12179-1-git-send-email-daniel.lezcano@linaro.org> References: <1366707285-12179-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlCWIpH0m8ezBc2ewLyQ/r83fl9fVR356LXv2iz4DwgNlRog6MS79+U655TWv91iDg4+a8A X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 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); }