From patchwork Wed Apr 10 14:22:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16023 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F71223912 for ; Wed, 10 Apr 2013 14:23:11 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ha12sf557934vcb.2 for ; Wed, 10 Apr 2013 07:22:52 -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=eKeCAxs5SEVN677GeDLdPJdiXKhkyNr5IyYJMm0Akdg=; b=OWYDrnuuj4UExlC9MZCro4SJMTTs2MpCK64SNV88WC3RiUcEiKhoxfrBbm0Xcr2gJ2 XTuQ4c6xRumojgE2+KgFT0hukK1t9kMe63KPH4N67WtLPukAe2mvG4RyTXF0RmBeZoC0 mEtS0IPbks65jLobYWjxf/wfbnG5BUAJPUAMPFKDGmZt+2VVM2vUn4LMNRbCdknWsWM7 zLE6ewOkZRuGuOZfcEXbwqvYqF/w8wDV6rqe2lRyO6FE9kCbkChdjYLJRIftfJwbbW54 EVuTJHiLTmyPAbIo6QZEVoCW8XWpc6jIA/X6UOuyUENVPqDkTo/ULjv4OjvdztwvpPDZ QWMA== X-Received: by 10.224.160.65 with SMTP id m1mr1569117qax.2.1365603772411; Wed, 10 Apr 2013 07:22:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.193 with SMTP id i1ls302550qes.36.gmail; Wed, 10 Apr 2013 07:22:52 -0700 (PDT) X-Received: by 10.220.223.80 with SMTP id ij16mr1671072vcb.28.1365603772247; Wed, 10 Apr 2013 07:22:52 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id pq1si125728vec.2.2013.04.10.07.22.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf10so416837vcb.15 for ; Wed, 10 Apr 2013 07:22:52 -0700 (PDT) X-Received: by 10.52.93.20 with SMTP id cq20mr1430529vdb.38.1365603771964; Wed, 10 Apr 2013 07:22:51 -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 h8csp107469vez; Wed, 10 Apr 2013 07:22:51 -0700 (PDT) X-Received: by 10.194.82.34 with SMTP id f2mr1907628wjy.25.1365603770801; Wed, 10 Apr 2013 07:22:50 -0700 (PDT) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [2a00:1450:400c:c03::232]) by mx.google.com with ESMTPS id d9si37318wie.117.2013.04.10.07.22.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:50 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::232 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::232; Received: by mail-we0-f178.google.com with SMTP id z53so408690wey.37 for ; Wed, 10 Apr 2013 07:22:50 -0700 (PDT) X-Received: by 10.194.173.167 with SMTP id bl7mr3888017wjc.50.1365603770280; Wed, 10 Apr 2013 07:22:50 -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.47 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:22:49 -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 07/18] ARM: at91: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:12 +0200 Message-Id: <1365603743-5618-8-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: ALoCoQk/GALriW4Kl+O1AQqxzxinlu4ertt5AhmddMhWNyt8bwM1QTUr4s7PvCEbdrOQNGcrVxlu X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 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 arm cpuidle driver's 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);