From patchwork Mon Mar 25 17:55:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15621 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 F0B1F23E2C for ; Mon, 25 Mar 2013 17:56:13 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id 97185A194BB for ; Mon, 25 Mar 2013 17:56:13 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id lf10so4995140vcb.29 for ; Mon, 25 Mar 2013 10:56:13 -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=SMz0P22wAl7FQd7prBDifZDVOTKSi/ROEVo8faEB5iM=; b=gbDu6bG+gsZtrm1uckFsHzOgz0/cddQhS70qTrGDc/jW19vvEW4Tm+RDTW/mO2lecc e0nGD0Ulm15jnP5ZoEHdTBponH5SJd86/RHkFg3oy4Yeqg3IsCOlK/4U80yuTMpoqnpv 7RFCNKN0wZnsQ03JwEZIi4Os3sX1n/dZoPTCDQIc2R77Krh6Pix60egr+V3o2qGRscpy wwgAvSiIQkjRGRJ4N9MDTuKlRdICup4K9wIuNM7TWqOtwtngWuqQdMkhKVLO3mt5EqDw opA+Oftds68k8v++LS5EFgYoqD4jcSRjmkpFwuoU78yrAaGrZqHFgs5weWbUaRfpIzLR 1rOg== X-Received: by 10.220.153.143 with SMTP id k15mr16743796vcw.33.1364234173170; Mon, 25 Mar 2013 10:56:13 -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 cg12csp37247ved; Mon, 25 Mar 2013 10:56:12 -0700 (PDT) X-Received: by 10.180.72.228 with SMTP id g4mr13696412wiv.22.1364234172339; Mon, 25 Mar 2013 10:56:12 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id pd8si2630213wjb.62.2013.03.25.10.56.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:12 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-f50.google.com with SMTP id es5so2999756wgb.5 for ; Mon, 25 Mar 2013 10:56:12 -0700 (PDT) X-Received: by 10.180.97.233 with SMTP id ed9mr27225813wib.32.1364234171926; Mon, 25 Mar 2013 10:56:11 -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.09 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:11 -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 12/15] ARM: tegra1: cpuidle: use init/exit common routine Date: Mon, 25 Mar 2013 18:55:37 +0100 Message-Id: <1364234140-514-13-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: ALoCoQmeKFDeDT1e7LqYWkNdEzFmAPly41iuYhKuTBdsdNNPeCpajUedvrONGNrVre/JLVi4G3NY Remove the duplicate code and use the arm cpuidle driver's common code for initialization. Signed-off-by: Daniel Lezcano --- arch/arm/mach-tegra/cpuidle-tegra114.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c index 0f4e8c4..771f6e8 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra114.c +++ b/arch/arm/mach-tegra/cpuidle-tegra114.c @@ -30,32 +30,7 @@ static struct cpuidle_driver tegra_idle_driver = { }, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - int __init tegra114_cpuidle_init(void) { - int ret; - unsigned int cpu; - struct cpuidle_device *dev; - struct cpuidle_driver *drv = &tegra_idle_driver; - - ret = cpuidle_register_driver(&tegra_idle_driver); - if (ret) { - pr_err("CPUidle driver registration failed\n"); - return ret; - } - - for_each_possible_cpu(cpu) { - dev = &per_cpu(tegra_idle_device, cpu); - dev->cpu = cpu; - - dev->state_count = drv->state_count; - ret = cpuidle_register_device(dev); - if (ret) { - pr_err("CPU%u: CPUidle device registration failed\n", - cpu); - return ret; - } - } - return 0; + return arm_cpuidle_init(&tegra_idle_driver); }