From patchwork Tue Apr 23 08:54:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16337 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@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 C7A772391B for ; Tue, 23 Apr 2013 08:55:54 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id p12sf708432vbe.8 for ; Tue, 23 Apr 2013 01:55:06 -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=LQIJorRygv5DfxqkjpQUjskJBsLIY9tSghoL1gfZ2dQ=; b=IpMYKnvn8M+qt6+mfsGiMxs2aTM/ZJDnFYaJcDDiorYutePDL9HEID7JjNgjGoXBZQ 41ZkEHe/8i6xW8RnbPBfNpyQzRnKy4pMrf/1JHSnx8lvj4xE00+rKnKdyuMfyz4UI2L4 ds65ZW6qiGgEacwbBZ6GDdUMqrvfoiLVgWg03HRRVe0shd5LKfF20RmA70hUaK1VSwLb Ah6FwcNrCZKUP3+tQuXDT8dlsb6Qim77WO6dtv4m1tQpuSdoH7Bn4cs0nIdMrCFUVqj/ WaSfHOIrumy3khhJE5fguGLQjhGoNQRK+I2GJuKXQF/peqnPSMt6LFHTiHNH4N+wgJja +sEQ== X-Received: by 10.224.217.195 with SMTP id hn3mr22188713qab.5.1366707306421; Tue, 23 Apr 2013 01:55:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.163 with SMTP id 3ls223907qef.58.gmail; Tue, 23 Apr 2013 01:55:06 -0700 (PDT) X-Received: by 10.52.174.196 with SMTP id bu4mr18141707vdc.117.1366707306296; Tue, 23 Apr 2013 01:55:06 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id pq1si18024323vec.11.2013.04.23.01.55.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ib11so354682vcb.23 for ; Tue, 23 Apr 2013 01:55:06 -0700 (PDT) X-Received: by 10.58.188.48 with SMTP id fx16mr21668343vec.22.1366707306119; Tue, 23 Apr 2013 01:55:06 -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 nf2csp113998veb; Tue, 23 Apr 2013 01:55:05 -0700 (PDT) X-Received: by 10.180.188.141 with SMTP id ga13mr18521308wic.9.1366707304793; Tue, 23 Apr 2013 01:55:04 -0700 (PDT) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [2a00:1450:400c:c00::235]) by mx.google.com with ESMTPS id xa10si4130655wjc.228.2013.04.23.01.55.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:04 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::235 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c00::235; Received: by mail-wg0-f53.google.com with SMTP id z11so158758wgg.32 for ; Tue, 23 Apr 2013 01:55:04 -0700 (PDT) X-Received: by 10.194.82.34 with SMTP id f2mr1360339wjy.25.1366707304371; Tue, 23 Apr 2013 01:55:04 -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.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:03 -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 06/15] ARM: OMAP3: cpuidle: use init/exit common routine Date: Tue, 23 Apr 2013 10:54:36 +0200 Message-Id: <1366707285-12179-7-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: ALoCoQk/iHMRnQkUHRniuY8J+QuaKWX85G6HnRqVShnzbXlFOrfQWfXY7aBnDdXIq27jinDtOpf2 X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 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: Santosh Shilimkar Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman --- arch/arm/mach-omap2/cpuidle34xx.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 20785b2..cca045c 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "powerdomain.h" #include "clockdomain.h" @@ -259,8 +260,6 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, return ret; } -static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); - static struct cpuidle_driver omap3_idle_driver = { .name = "omap3_idle", .owner = THIS_MODULE, @@ -336,8 +335,6 @@ static struct cpuidle_driver omap3_idle_driver = { */ int __init omap3_idle_init(void) { - struct cpuidle_device *dev; - mpu_pd = pwrdm_lookup("mpu_pwrdm"); core_pd = pwrdm_lookup("core_pwrdm"); per_pd = pwrdm_lookup("per_pwrdm"); @@ -346,20 +343,5 @@ int __init omap3_idle_init(void) if (!mpu_pd || !core_pd || !per_pd || !cam_pd) return -ENODEV; - if (cpuidle_register_driver(&omap3_idle_driver)) { - pr_err("%s: CPUidle driver register failed\n", __func__); - return -EIO; - } - - dev = &per_cpu(omap3_idle_dev, smp_processor_id()); - dev->cpu = 0; - - if (cpuidle_register_device(dev)) { - printk(KERN_ERR "%s: CPUidle register device failed\n", - __func__); - cpuidle_unregister_driver(&omap3_idle_driver); - return -EIO; - } - - return 0; + return cpuidle_register(&omap3_idle_driver, NULL); }