From patchwork Tue Apr 23 08:54:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2476561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id E0B123FCA5 for ; Tue, 23 Apr 2013 08:57:39 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ1V-000410-AU; Tue, 23 Apr 2013 08:56:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ14-0003Ff-8N; Tue, 23 Apr 2013 08:55:58 +0000 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUZ0C-00034J-FO for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 08:55:05 +0000 Received: by mail-wg0-f49.google.com with SMTP id x12so151884wgg.28 for ; Tue, 23 Apr 2013 01:55:01 -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=nahRxbx5FgunrR8B/BkMzvdSA+ox3J5oBUOmHrNOzAY=; b=iXNAvOg/IVDstaN2cgKzXxTkhML6MJg23/JUs8lF5ybMyraOerYNI4tRKjaluTVuSM dlIkE2glNcYeisolHrEr5UaVrT4470cx9HOc3hh4IVu3ih9W+lYO+Aqq7ZPmrIbPFK5t 8E5TNGV4/BkJ0qXRDfR7vHly6K/BbGk1wSrDhZK+cVyeMgEZoGwW3Ecd2JmSFxl7EIkW z+JsF5HFKDIWKQUtbQc4av/47Fhs+i8uWUaSChmOzO5Qz2/OVj/99XtPVAx6Tsq/EKRa kKNUyxZUBGB5yFeQaWWI1JGDD8kyi5w6n0bgofRhtg9TkywqgorwotVB0SZIjgMG4E8O gqvA== X-Received: by 10.180.188.3 with SMTP id fw3mr27845705wic.33.1366707301750; Tue, 23 Apr 2013 01:55:01 -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.54.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:01 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Subject: [V4 patch 05/15] ARM: at91: cpuidle: use init/exit common routine Date: Tue, 23 Apr 2013 10:54:35 +0200 Message-Id: <1366707285-12179-6-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: ALoCoQkA0fP5KmtdQnsK8Zh+LqjosehhinhdoKRnTP5Oc2jkpx9KFCSmdDx6gBTeRL4yg4if6+JA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130423_045504_684058_AFF4B17B X-CRM114-Status: GOOD ( 12.75 ) 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: Nicolas Ferre --- arch/arm/mach-at91/cpuidle.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c index 0130df7..48f1228 100644 --- a/arch/arm/mach-at91/cpuidle.c +++ b/arch/arm/mach-at91/cpuidle.c @@ -27,8 +27,6 @@ #define AT91_MAX_STATES 2 -static DEFINE_PER_CPU(struct cpuidle_device, at91_cpuidle_device); - /* Actual code that puts the SoC in different idle states */ static int at91_enter_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, @@ -60,20 +58,9 @@ static struct cpuidle_driver at91_idle_driver = { }; /* Initialize CPU idle by registering the idle states */ -static int at91_init_cpuidle(void) +static int __init at91_init_cpuidle(void) { - struct cpuidle_device *device; - - device = &per_cpu(at91_cpuidle_device, smp_processor_id()); - device->state_count = AT91_MAX_STATES; - - cpuidle_register_driver(&at91_idle_driver); - - if (cpuidle_register_device(device)) { - printk(KERN_ERR "at91_init_cpuidle: Failed registering\n"); - return -EIO; - } - return 0; + return cpuidle_register(&at91_idle_driver, NULL); } device_initcall(at91_init_cpuidle);