From patchwork Wed Apr 10 14:22:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16022 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-ea0-f198.google.com (mail-ea0-f198.google.com [209.85.215.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9351923912 for ; Wed, 10 Apr 2013 14:23:10 +0000 (UTC) Received: by mail-ea0-f198.google.com with SMTP id h10sf685089eaj.5 for ; Wed, 10 Apr 2013 07:22:50 -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=TI+eI+pyfrJmIdVSLGNG6GRkx9fuJra3Wz3QeGEJwmY=; b=gt0zrEpG0oP4zSAy+htixbg7AsNJTF9rr3P6RKz6VRWptgL7SH7j6IAeLFD+2588oG dHBncoDOD78LcWraFqeExuR/2HOqekpEO9xb4/zcJ6YGPCo9l6z5qNeWbMOZIBB5RG0F ru++wC58+Z+nAXZT2MUx3rQoWxhZhsNSMnnGbY3gXCR5TR0LDHtFVib2FI2s3q0sNUHe YwMV8/iWJv+H1JPVDpqMprqpLoPfI1g3PNkipgwe2j+hCyWTB5RJrgrLnaz+bLOzt9U3 dEL0vQIhUYKDxOSv7dyswzoWDbd6XqDuTAjTm7PmYheIL0+nLPr6hj4c8z72Fakz/BA3 39ow== X-Received: by 10.180.20.239 with SMTP id q15mr5276289wie.7.1365603770645; Wed, 10 Apr 2013 07:22:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.189.166 with SMTP id gj6ls1683957wic.26.canary; Wed, 10 Apr 2013 07:22:50 -0700 (PDT) X-Received: by 10.194.219.162 with SMTP id pp2mr3950843wjc.27.1365603770283; Wed, 10 Apr 2013 07:22:50 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id gb16si8107726wic.8.2013.04.10.07.22.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id m1so453383ves.13 for ; Wed, 10 Apr 2013 07:22:49 -0700 (PDT) X-Received: by 10.52.245.6 with SMTP id xk6mr1349293vdc.114.1365603769117; Wed, 10 Apr 2013 07:22:49 -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 h8csp107468vez; Wed, 10 Apr 2013 07:22:48 -0700 (PDT) X-Received: by 10.180.73.212 with SMTP id n20mr3851511wiv.11.1365603767836; Wed, 10 Apr 2013 07:22:47 -0700 (PDT) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id ff16si8083508wic.113.2013.04.10.07.22.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:47 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.47; Received: by mail-wg0-f47.google.com with SMTP id y10so530006wgg.2 for ; Wed, 10 Apr 2013 07:22:47 -0700 (PDT) X-Received: by 10.194.3.4 with SMTP id 4mr1230038wjy.53.1365603767440; Wed, 10 Apr 2013 07:22:47 -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.22.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:46 -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 06/18] ARM: ux500: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:11 +0200 Message-Id: <1365603743-5618-7-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: ALoCoQkooyRYhnO+D4U6FY+Y1isz0wCpzIaJ5DhCvc2pJ2bANr+ObF52pdcyXksQA3SfsAkQoEFa X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 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 duplicate code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano --- 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 5657d4a..488e074 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) @@ -112,40 +111,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_possible(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_possible_cpu(cpu) { - device = &per_cpu(ux500_cpuidle_device, cpu); - cpuidle_unregister_device(device); - } - - cpuidle_unregister_driver(&ux500_idle_driver); - goto out; + return cpuidle_register(&ux500_idle_driver, NULL); } device_initcall(ux500_idle_init);