From patchwork Fri Apr 12 12:35:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16102 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B187277E3 for ; Fri, 12 Apr 2013 12:37:12 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hj8sf2057610wib.1 for ; Fri, 12 Apr 2013 05:36:48 -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=NnzA9Dop/N3s4HhJh8qKUuaPcL7NhJDnZ7ZLYQPYVvw=; b=V3Chji0qOIueMKNvaZ5vZrxHX3D/AGK5ExHvosil65yHUF/afCvCKn++sezGuA/ROx xlAjdKxWQFBe5cS2qpUHa16k/n2rnyrY2NijEomvsUC9BOm8lmFVo/yP2rcKxWqgcAsE o0RsB5ZC+3t7QKZUu1DbdZ70QpIlMW7yRhgqXomDU0K2OktQgUlT8qP0CSHxlriyLWQN FViac1BzD35u8O/W7bpsfw6ob2LjxQNtpnL4La5slS4cUz8FBzZQqJ1vTf8aDTAwu8tk aHRiQrNgkKOhWewQl/Qq/jeKcLNnj4oYhKSsT+VL1RsbLU+o6mvaaCwPKLtVyk4YEZOS Yhjw== X-Received: by 10.180.20.239 with SMTP id q15mr857450wie.7.1365770208187; Fri, 12 Apr 2013 05:36:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.182.197 with SMTP id eg5ls497951wic.19.gmail; Fri, 12 Apr 2013 05:36:48 -0700 (PDT) X-Received: by 10.194.222.3 with SMTP id qi3mr11157877wjc.28.1365770208055; Fri, 12 Apr 2013 05:36:48 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id hs2si797427wib.68.2013.04.12.05.36.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id cy12so2361840veb.18 for ; Fri, 12 Apr 2013 05:36:46 -0700 (PDT) X-Received: by 10.220.214.6 with SMTP id gy6mr8219095vcb.8.1365770206859; Fri, 12 Apr 2013 05:36:46 -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 nf2csp64084veb; Fri, 12 Apr 2013 05:36:46 -0700 (PDT) X-Received: by 10.180.92.229 with SMTP id cp5mr3726712wib.20.1365770195720; Fri, 12 Apr 2013 05:36:35 -0700 (PDT) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [2a00:1450:400c:c00::229]) by mx.google.com with ESMTPS id bv17si789650wib.113.2013.04.12.05.36.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:35 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::229 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c00::229; Received: by mail-wg0-f41.google.com with SMTP id m15so188178wgh.0 for ; Fri, 12 Apr 2013 05:36:35 -0700 (PDT) X-Received: by 10.180.183.197 with SMTP id eo5mr3751931wic.28.1365770195227; Fri, 12 Apr 2013 05:36:35 -0700 (PDT) Received: from mai.home (AToulouse-654-1-349-85.w90-55.abo.wanadoo.fr. [90.55.188.85]) by mx.google.com with ESMTPS id ej8sm3043646wib.9.2013.04.12.05.36.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:36:34 -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: [V3 patch 08/19] ARM: at91: cpuidle: use init/exit common routine Date: Fri, 12 Apr 2013 14:35:54 +0200 Message-Id: <1365770165-27096-9-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365770165-27096-1-git-send-email-daniel.lezcano@linaro.org> References: <1365770165-27096-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkA43SMh/TlGtUjHgUjw2zMfmipj0+GLZk1ybouyA5VVCKj1gDe9YS0r7+ioN7rqM8k/ZFv X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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);