From patchwork Tue Apr 23 08:54:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2476831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 61EB9DF2E5 for ; Tue, 23 Apr 2013 10:09:19 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ9r-0006sh-TW; Tue, 23 Apr 2013 09:05:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ2b-0003M9-Q6; Tue, 23 Apr 2013 08:57:33 +0000 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ0L-00036O-RX for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 08:55:16 +0000 Received: by mail-we0-f170.google.com with SMTP id z2so367262wey.1 for ; Tue, 23 Apr 2013 01:55:11 -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=q7+F+XdHKbVaQS0EUkMhpDwL7bnrlmP5YNbSo4D0RjA=; b=Ud5lJf5IkAVOsFFZKRAZQ/4sA6k/N3LFL8aniT3UJgVIlJyoEuP05saUZL6D8Hyj/k ppjxLGPYjI/kQJ+Y3JDyFEfxN8tb5MVNORTZvYdvndLBrJ7MG4D9RkuQtgC1Oi7kyWXp FdrDXG0Ov/SthKKjfvaagWsB3sFdo3xbod5/uZxgTmXFzIuIAmm+53K3OiJCxFhk6Noa VWBdM5DNzilrK5f9HHMzkFPuTaeEwSlNvh9M2OKNcPGZ1VmOrG8XsNaa9MUj1WGHjocd 9mwy1CaRNmV+UOEZw51EOs0SSsX6FMnfnil2XNwzKV9OxLsyuGccT7d0GEkPRW3yPDBy Cylw== X-Received: by 10.194.108.165 with SMTP id hl5mr9129829wjb.22.1366707311899; Tue, 23 Apr 2013 01:55:11 -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.09 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:11 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Subject: [V4 patch 09/15] ARM: OMAP4: cpuidle: use init/exit common routine Date: Tue, 23 Apr 2013 10:54:39 +0200 Message-Id: <1366707285-12179-10-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: ALoCoQnsiNKkovAcNtJbvBTKMukFe8gOPhqPkFvTeRGl6BYjif+cDykYcA8k5nXSGvufnYofobfV X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130423_045514_076157_D1D5321F X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: andrew@lunn.ch, kgene.kim@samsung.com, jason@lakedaemon.net, horms@verge.net.au, patches@linaro.org, khilman@deeprootsystems.com, magnus.damm@gmail.com, linux-pm@vger.kernel.org, swarren@wwwdotorg.org, nsekhar@ti.com, rob.herring@calxeda.com, deepthi@linux.vnet.ibm.com, tony@atomide.com, lethal@linux-sh.org, linaro-kernel@lists.linaro.org, kernel@pengutronix.de, josephl@nvidia.com, jkosina@suse.cz, plagnioj@jcrosoft.com, linux@maxim.org.za, linux-arm-kernel@lists.infradead.org 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 Acked-by: Santosh Shilimkar Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman --- arch/arm/mach-omap2/cpuidle44xx.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index d1bfb21..5a286b5 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" @@ -159,8 +160,6 @@ fail: return index; } -static DEFINE_PER_CPU(struct cpuidle_device, omap_idle_dev); - static struct cpuidle_driver omap4_idle_driver = { .name = "omap4_idle", .owner = THIS_MODULE, @@ -209,9 +208,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"); @@ -223,23 +219,5 @@ int __init omap4_idle_init(void) if (!cpu_clkdm[0] || !cpu_clkdm[1]) return -ENODEV; - if (cpuidle_register_driver(&omap4_idle_driver)) { - pr_err("%s: CPUidle driver register failed\n", __func__); - return -EIO; - } - - for_each_cpu(cpu_id, cpu_online_mask) { - dev = &per_cpu(omap_idle_dev, cpu_id); - dev->cpu = cpu_id; -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED - dev->coupled_cpus = *cpu_online_mask; -#endif - if (cpuidle_register_device(dev)) { - pr_err("%s: CPUidle register failed\n", __func__); - cpuidle_unregister_driver(&omap4_idle_driver); - return -EIO; - } - } - - return 0; + return cpuidle_register(&omap4_idle_driver, cpu_online_mask); }