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: 16336 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9FF7A2391B for ; Tue, 23 Apr 2013 08:55:53 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id m6sf535918wiv.3 for ; Tue, 23 Apr 2013 01:55:04 -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=nahRxbx5FgunrR8B/BkMzvdSA+ox3J5oBUOmHrNOzAY=; b=ZevlIFTMoOgwO983CZRD3IIle3BuLrEPUUdA7HgbN37TTzpnpR+vBqyJCvcvN7vAkC LwAhvqti1n4iEHFXxUHL7XURC5CZQNjKYaLA2yM9rwdkkc1SaAwnyEsMrBnGLU9ShNO5 d+AH/NzsTgMRJNsFfWEOn07o+XSqmnZIggPQFfdZMGrttewbNIR3Z1jDhrhN79W1OBZK cJCgo7mNjiQHqOj4WPuyBGaR7UoSpUJj/+gGBieNWHm/MOfOFoLmIK0GSxQeKjALi4TP vD3Olmg7oqdVMBvSUqWG8WdjRJWfngkfmZVH5L65qO/cxcX6bvw1PPfTHtvBUOdWTCZR CjRQ== X-Received: by 10.180.106.232 with SMTP id gx8mr14964242wib.2.1366707304528; Tue, 23 Apr 2013 01:55:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.78.163 with SMTP id c3ls1027849wix.44.canary; Tue, 23 Apr 2013 01:55:04 -0700 (PDT) X-Received: by 10.180.39.207 with SMTP id r15mr21311613wik.16.1366707304381; Tue, 23 Apr 2013 01:55:04 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id bq9si10329059wjb.148.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: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::230; Received: by mail-ve0-f176.google.com with SMTP id cz11so131120veb.35 for ; Tue, 23 Apr 2013 01:55:03 -0700 (PDT) X-Received: by 10.220.169.78 with SMTP id x14mr6637063vcy.41.1366707303167; Tue, 23 Apr 2013 01:55:03 -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 nf2csp113997veb; Tue, 23 Apr 2013 01:55:02 -0700 (PDT) X-Received: by 10.180.13.34 with SMTP id e2mr49470471wic.29.1366707302192; Tue, 23 Apr 2013 01:55:02 -0700 (PDT) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [2a00:1450:400c:c00::231]) by mx.google.com with ESMTPS id b4si5923517wie.42.2013.04.23.01.55.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 01:55:02 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::231 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c00::231; Received: by mail-wg0-f49.google.com with SMTP id x12so152737wgg.4 for ; Tue, 23 Apr 2013 01:55:01 -0700 (PDT) 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 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 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: ALoCoQkAbepKFP9QPTd/Vt6ETEisn8wb5e/DCyH1bcEaFKpjc00jNjkKtpxciqafVD3WziWeKdPm X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 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: 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);