From patchwork Mon Mar 25 17:55:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15617 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AF94823E2C for ; Mon, 25 Mar 2013 17:56:03 +0000 (UTC) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by fiordland.canonical.com (Postfix) with ESMTP id 2E8ACA19491 for ; Mon, 25 Mar 2013 17:56:03 +0000 (UTC) Received: by mail-vb0-f47.google.com with SMTP id e21so3955131vbm.6 for ; Mon, 25 Mar 2013 10:56:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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; bh=lxe44Acx29iHqqe8D/eGH0NLpAMMUAtozUU3/DGWgdg=; b=MXyZeIWe/PvkyOQJMjkSyxZFn3ScIPWPlYBZlf+tdxWXOyCQ+R8rMqCt5+y5nb2edw LGyvGZulhKNp4Mftdj06XPWdm2zgSaB11KsS/u39Pw+V+BjmEe46JjMO8CU++GILDIbT oQr+/KfzgKqsn6W6mOWL8viug9muu1Rr5r4gTgCX45q4wMMGHZIQOQeVxut8yuVPoFAr wble94E3te6Au96o6/3dZxA4XpTzsZHPxlE3WCxKqEO2bD4DIafXDDiW99PCAynkd/ro Cvjz6lPsTZEJt8TRs1giW2SkhU4sughVAhF/GanZLDQWaVm0v7Ujog3JgARo8xdui5Qj C+Xg== X-Received: by 10.220.150.74 with SMTP id x10mr16878405vcv.68.1364234162676; Mon, 25 Mar 2013 10:56:02 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp37234ved; Mon, 25 Mar 2013 10:56:02 -0700 (PDT) X-Received: by 10.194.57.137 with SMTP id i9mr19768031wjq.18.1364234161538; Mon, 25 Mar 2013 10:56:01 -0700 (PDT) Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by mx.google.com with ESMTPS id pu2si5367344wjc.210.2013.03.25.10.56.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:01 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::233 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c05::233; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::233 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wi0-f179.google.com with SMTP id hn17so4366563wib.6 for ; Mon, 25 Mar 2013 10:56:01 -0700 (PDT) X-Received: by 10.194.103.72 with SMTP id fu8mr19729732wjb.42.1364234161036; Mon, 25 Mar 2013 10:56:01 -0700 (PDT) Received: from mai.home (AToulouse-654-1-426-131.w2-6.abo.wanadoo.fr. [2.6.209.131]) by mx.google.com with ESMTPS id s2sm23927749wib.4.2013.03.25.10.55.58 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:00 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl, tglx@linutronix.de Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux@maxim.org.za, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, lenb@kernel.org, nsekhar@ti.com, kevin.hilman@linaro.org, horms@verge.net.au, magnus.damm@gmail.com, kernel@pengutronix.de, ben-linux@fluff.org, kgene.kim@samsung.com, rob.herring@calxeda.com, jason@lakedaemon.net, andrew@lunn.ch, linus.walleij@linaro.org, linux@arm.linux.org.uk Subject: [PATCH 08/15] ARM: ux500: cpuidle: use init/exit common routine Date: Mon, 25 Mar 2013 18:55:33 +0100 Message-Id: <1364234140-514-9-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> References: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQnYje+KGJ4ZoKtJeURv2rQW2mLUYS+zbv7BpdqSI0uTm0TIl4pr0K4LjDV3OSZFPjm822Gh Remove the duplicate code and use the arm cpuidle driver's common code for initialization. Signed-off-by: Daniel Lezcano Acked-by: Linus Walleij --- arch/arm/mach-ux500/cpuidle.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c index 1b16d9e..ee81d22 100644 --- a/arch/arm/mach-ux500/cpuidle.c +++ b/arch/arm/mach-ux500/cpuidle.c @@ -21,7 +21,6 @@ static atomic_t master = ATOMIC_INIT(0); static DEFINE_SPINLOCK(master_lock); -static DEFINE_PER_CPU(struct cpuidle_device, ux500_cpuidle_device); static inline int ux500_enter_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) @@ -113,40 +112,11 @@ static struct cpuidle_driver ux500_idle_driver = { int __init ux500_idle_init(void) { - int ret, cpu; - struct cpuidle_device *device; - /* Configure wake up reasons */ prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | PRCMU_WAKEUP(ABB)); - ret = cpuidle_register_driver(&ux500_idle_driver); - if (ret) { - printk(KERN_ERR "failed to register ux500 idle driver\n"); - return ret; - } - - for_each_online_cpu(cpu) { - device = &per_cpu(ux500_cpuidle_device, cpu); - device->cpu = cpu; - ret = cpuidle_register_device(device); - if (ret) { - printk(KERN_ERR "Failed to register cpuidle " - "device for cpu%d\n", cpu); - goto out_unregister; - } - } -out: - return ret; - -out_unregister: - for_each_online_cpu(cpu) { - device = &per_cpu(ux500_cpuidle_device, cpu); - cpuidle_unregister_device(device); - } - - cpuidle_unregister_driver(&ux500_idle_driver); - goto out; + return arm_cpuidle_init(&ux500_idle_driver); } device_initcall(ux500_idle_init);