From patchwork Mon Mar 25 17:55:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15618 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 37DF223E2C for ; Mon, 25 Mar 2013 17:56:06 +0000 (UTC) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by fiordland.canonical.com (Postfix) with ESMTP id CEC51A194C8 for ; Mon, 25 Mar 2013 17:56:05 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so5122794vea.2 for ; Mon, 25 Mar 2013 10:56:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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; bh=xZEDxzD3pQzNOHrRIhflhFli2EqF0LaKsrAfQCcA+ww=; b=TCvK2RdPXxB2FR/j1b8iYf8J/XkG+VqGONKXZ0hQNpce3Cagmpft3KsY3HbNiptlaV 0Ad+c31hCkYpp/fHxYFoFOgMAtbNpTbchqciYuUVoDeTuZRs+lFlAjiQ5P/7Cck2gKLX oUh70887KMI1fskpOm7I3mQUlWIQHd+//h5QNPRAoMxC5Srj/S6nvb1c3aMpDrN8GwoL yJuaSRGRQvjX6qMg42th6GoTo+goqfvZJwcULSXinYijYadthB4UkJhxmpOZ61NGiI1P nzWaaJk0m/HKp3x4LuVTb83TugGDLLdpYpkCGjbQJs+3iY/gfyfsrxMSDQDgQRH2ayKO 8gIw== X-Received: by 10.52.93.20 with SMTP id cq20mr14339920vdb.38.1364234165383; Mon, 25 Mar 2013 10:56:05 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp37239ved; Mon, 25 Mar 2013 10:56:04 -0700 (PDT) X-Received: by 10.181.11.196 with SMTP id ek4mr8407390wid.30.1364234164339; Mon, 25 Mar 2013 10:56:04 -0700 (PDT) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by mx.google.com with ESMTPS id p5si5374858wiy.92.2013.03.25.10.56.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:04 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.49 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.49 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wg0-f49.google.com with SMTP id gg9so4711686wgb.28 for ; Mon, 25 Mar 2013 10:56:03 -0700 (PDT) X-Received: by 10.180.92.97 with SMTP id cl1mr27409060wib.19.1364234163838; Mon, 25 Mar 2013 10:56:03 -0700 (PDT) Received: from mai.home (AToulouse-654-1-426-131.w2-6.abo.wanadoo.fr. [2.6.209.131]) by mx.google.com with ESMTPS id s2sm23927749wib.4.2013.03.25.10.56.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:02 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl, tglx@linutronix.de Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux@maxim.org.za, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, lenb@kernel.org, nsekhar@ti.com, kevin.hilman@linaro.org, horms@verge.net.au, magnus.damm@gmail.com, kernel@pengutronix.de, ben-linux@fluff.org, kgene.kim@samsung.com, rob.herring@calxeda.com, jason@lakedaemon.net, andrew@lunn.ch, linus.walleij@linaro.org, linux@arm.linux.org.uk Subject: [PATCH 09/15] ARM: at91: cpuidle: use init/exit common routine Date: Mon, 25 Mar 2013 18:55:34 +0100 Message-Id: <1364234140-514-10-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> References: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmeY014cLFI2C8gFUIZUc2tQLGHRECRcxE6rN+r5bYkapPWV4mJlz2mMIMmFNwC9ag2y0WA 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 0c63815..0aa2c0f 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, @@ -61,20 +59,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 arm_cpuidle_init(&at91_idle_driver); } device_initcall(at91_init_cpuidle);