From patchwork Wed Apr 10 14:22:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16034 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EC9A23912 for ; Wed, 10 Apr 2013 14:23:53 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id b14sf673046qcs.4 for ; Wed, 10 Apr 2013 07:23:34 -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=S2ItMkeTplB5ukAhwvXaJOmaHQuOUxrx4ubSKfk84Rs=; b=mrWV1x+TfEHZPBAgiQclgjpQoYtwTIxQVNA5XzfO7jZnxwj0mNEKIgOjuocadTKGrO /6n2oeLNATUTDTJA+8/s61tRl/O6kkG10U3CWt0sXvGSjs6QSYUccGtBjLBbiIzQFy4X zwkESmNSE2Z4iiWerf6IdhpGff7PaOWKr29APH54bwWzG2fVe0wI8tUZFzXXHaKSc3Mm clfew7WGptgs/eWvENTZiUp9iQM5DyC78r2n38UZtz+y4WSByf0puHAHYQva8umuE9uR PBUTJgjeychotF7MNZeYZp4cd/90xWD8YFZF8MpypbAB1GA0QC/78/ShKCatGLHGLrMv ZE3g== X-Received: by 10.224.18.132 with SMTP id w4mr1571848qaa.1.1365603814077; Wed, 10 Apr 2013 07:23:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.69 with SMTP id o5ls256513qej.55.gmail; Wed, 10 Apr 2013 07:23:34 -0700 (PDT) X-Received: by 10.52.66.176 with SMTP id g16mr1423626vdt.72.1365603813859; Wed, 10 Apr 2013 07:23:33 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id sx2si120472vdc.19.2013.04.10.07.23.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 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:c02::230; Received: by mail-vb0-f48.google.com with SMTP id p13so395516vbe.21 for ; Wed, 10 Apr 2013 07:23:33 -0700 (PDT) X-Received: by 10.52.21.212 with SMTP id x20mr1359249vde.106.1365603813550; Wed, 10 Apr 2013 07:23:33 -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.85.136 with SMTP id h8csp107508vez; Wed, 10 Apr 2013 07:23:33 -0700 (PDT) X-Received: by 10.194.89.169 with SMTP id bp9mr3869852wjb.57.1365603812648; Wed, 10 Apr 2013 07:23:32 -0700 (PDT) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [2a00:1450:400c:c00::229]) by mx.google.com with ESMTPS id x5si42097wja.156.2013.04.10.07.23.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:32 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::229 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c00::229; Received: by mail-wg0-f41.google.com with SMTP id y10so6052817wgg.0 for ; Wed, 10 Apr 2013 07:23:32 -0700 (PDT) X-Received: by 10.194.222.3 with SMTP id qi3mr3942477wjc.28.1365603785579; Wed, 10 Apr 2013 07:23:05 -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.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:04 -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: [PATCH 12/18] ARM: OMAP4: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:17 +0200 Message-Id: <1365603743-5618-13-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: ALoCoQlCaeYlxgEPZBPSW1tBCNiSsiIxZT7IKthA8eQItP5JbdZtu0bxCVUJ9TcKTDg5nwC6aN4L X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 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 --- arch/arm/mach-omap2/cpuidle44xx.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index cd188de..861dd90 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -15,6 +15,7 @@ #include #include +#include #include #include "common.h" @@ -157,8 +158,6 @@ fail: return index; } -static DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev); - static struct cpuidle_driver omap4_idle_driver = { .name = "omap4_idle", .owner = THIS_MODULE, @@ -207,9 +206,6 @@ static struct cpuidle_driver omap4_idle_driver = { */ int __init omap4_idle_init(void) { - struct cpuidle_device *dev; - unsigned int cpu_id = 0; - mpu_pd = pwrdm_lookup("mpu_pwrdm"); cpu_pd[0] = pwrdm_lookup("cpu0_pwrdm"); cpu_pd[1] = pwrdm_lookup("cpu1_pwrdm"); @@ -221,19 +217,5 @@ int __init omap4_idle_init(void) if (!cpu_clkdm[0] || !cpu_clkdm[1]) return -ENODEV; - for_each_cpu(cpu_id, cpu_online_mask) { - dev = &per_cpu(omap4_idle_dev, cpu_id); - dev->cpu = cpu_id; -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED - dev->coupled_cpus = *cpu_online_mask; -#endif - cpuidle_register_driver(&omap4_idle_driver); - - if (cpuidle_register_device(dev)) { - pr_err("%s: CPUidle register failed\n", __func__); - return -EIO; - } - } - - return 0; + return cpuidle_register(&omap4_idle_driver, cpu_online_mask); }