From patchwork Thu Apr 11 20:42:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2431461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 6AD95DF230 for ; Thu, 11 Apr 2013 20:51:50 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQOSp-0005ds-PT; Thu, 11 Apr 2013 20:51:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQONb-0005LM-Pl; Thu, 11 Apr 2013 20:45:59 +0000 Received: from mail-wg0-f50.google.com ([74.125.82.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQOLL-00056R-8K for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2013 20:43:52 +0000 Received: by mail-wg0-f50.google.com with SMTP id k13so2048990wgh.17 for ; Thu, 11 Apr 2013 13:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=NgEzI05uKwSQUGJC7/HZnec019J84VVnPzOhnMXsMw0=; b=Q+Pk1s3FnNGa4q0cCZBtO+dFL8GHEnCCgK8ruP/OMbHVRkG71p4i+G8puMbqxaoM8N 9r860PXIyjDt9Ne75WwGvPW5wZ0Vdh1JQeWrxYGdffFDJBaPjB0lWSqd3TbigWHCW680 fnV4byKDTHC8AegHK1MFTK5EWMJ0pSq4d2DGYiRL0/w+JeH7WJcbwDgDltJKr5hEQOa4 Co3iQQr5dTQCBhTM0+CDBx8T1WjbCXWYQvMIMwhmHxw+CJ2Josn4vO6tl9py5Dl8O//C MEqFiiZw5mctmgDDS2jBbEu5Wvm0NW/dOyjHmBTokaEj/e3MmlpRVDP58faRD2fTMHRK j3qA== X-Received: by 10.180.11.148 with SMTP id q20mr36610445wib.18.1365713018104; Thu, 11 Apr 2013 13:43:38 -0700 (PDT) Received: from mai.home (AToulouse-654-1-501-244.w83-205.abo.wanadoo.fr. [83.205.84.244]) by mx.google.com with ESMTPS id fv2sm5794029wib.6.2013.04.11.13.43.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Apr 2013 13:43:37 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Subject: [V2 patch 17/19] ARM: kirkwood: cpuidle: use init/exit common routine Date: Thu, 11 Apr 2013 22:42:47 +0200 Message-Id: <1365712969-7541-18-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365712969-7541-1-git-send-email-daniel.lezcano@linaro.org> References: <1365712969-7541-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmRT4XsyhlLnxyRdsi1LITq0l+HM5m5vTxs6+xQQ7E/aQ7KgJCcD+g4DNPxpo/V9iuNHd6X X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130411_164339_597757_909E241F X-CRM114-Status: GOOD ( 12.59 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.50 listed in list.dnswl.org] 1.7 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: andrew@lunn.ch, khilman@deeprootsystems.com, linus.walleij@linaro.org, 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, nicolas.ferre@atmel.com, 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, santosh.shilimkar@ti.com, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Remove the duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano --- drivers/cpuidle/cpuidle-kirkwood.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c index 6f31524..53290e1 100644 --- a/drivers/cpuidle/cpuidle-kirkwood.c +++ b/drivers/cpuidle/cpuidle-kirkwood.c @@ -52,9 +52,6 @@ static struct cpuidle_driver kirkwood_idle_driver = { }, .state_count = KIRKWOOD_MAX_STATES, }; -static struct cpuidle_device *device; - -static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device); /* Initialize CPU idle by registering the idle states */ static int kirkwood_cpuidle_probe(struct platform_device *pdev) @@ -69,22 +66,12 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev) if (IS_ERR(ddr_operation_base)) return PTR_ERR(ddr_operation_base); - device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id()); - device->state_count = KIRKWOOD_MAX_STATES; - - cpuidle_register_driver(&kirkwood_idle_driver); - if (cpuidle_register_device(device)) { - pr_err("kirkwood_init_cpuidle: Failed registering\n"); - return -EIO; - } - return 0; + return cpuidle_register(&kirkwood_idle_driver, NULL); } int kirkwood_cpuidle_remove(struct platform_device *pdev) { - cpuidle_unregister_device(device); - cpuidle_unregister_driver(&kirkwood_idle_driver); - + cpuidle_unregister(&kirkwood_idle_driver); return 0; }