From patchwork Wed Apr 10 14:22:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2421891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id A7C2F3FD8C for ; Wed, 10 Apr 2013 14:35:28 +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 1UPw42-0003EN-6C; Wed, 10 Apr 2013 14:31:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPvxh-0006eg-DC; Wed, 10 Apr 2013 14:25:21 +0000 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPvvn-0006U1-Bu for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2013 14:23:24 +0000 Received: by mail-wi0-f170.google.com with SMTP id hm11so6215832wib.1 for ; Wed, 10 Apr 2013 07:23:20 -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=GTCwJJebhTEjLx4qKuAt8pc+FtkQyyJG7T4ATX9hatI=; b=EewYxCKSy0R3bqY19hHC2piFwJUrBjLuTlk8rcdGPR0uFmnsZfAIr3cqFLQunr+d9x 0n9oUfof6s37hQz6yzUduQUPNymFaWQHmDdWJ2sHWUacGDOLMXrgGSTx4AA/6cNRHDPq roRG1JKbuXUAPRYuMrlGAKtG9Tx2IHMCB0Osq2Ye0i0jgFtO+RwmBeznHGWZgWz8Wfyf 9MRGnH13mhZwl9hfv+nvYJK5pHsgBn5Yg1l/PeUSriDVUz2vs4TEGkQORL72I2tCb9Jd JXZXRDqNU+d+EiC2ua2RWWX+Enm6aT4lz2vJQTBojLaMfchoAw76XZWHjMADyq+zQM+c Bn7g== X-Received: by 10.194.10.129 with SMTP id i1mr3996430wjb.21.1365603800818; Wed, 10 Apr 2013 07:23:20 -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.23.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:20 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Subject: [PATCH 17/18] ARM: davinci: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:22 +0200 Message-Id: <1365603743-5618-18-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: ALoCoQkm03rdki4Ol7v73FWj0ukFQJdlZbvqE4VzDJPCs9y/oI5+x0O47ruerRuaVThwnGXWBoel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130410_102323_630927_B7C04224 X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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 --- arch/arm/mach-davinci/cpuidle.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index c2887c5..36aef3a 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c @@ -25,7 +25,6 @@ #define DAVINCI_CPUIDLE_MAX_STATES 2 -static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); static void __iomem *ddr2_reg_base; static bool ddr2_pdown; @@ -76,12 +75,8 @@ static struct cpuidle_driver davinci_idle_driver = { static int __init davinci_cpuidle_probe(struct platform_device *pdev) { - int ret; - struct cpuidle_device *device; struct davinci_cpuidle_config *pdata = pdev->dev.platform_data; - device = &per_cpu(davinci_cpuidle_device, smp_processor_id()); - if (!pdata) { dev_err(&pdev->dev, "cannot get platform data\n"); return -ENOENT; @@ -91,20 +86,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev) ddr2_pdown = pdata->ddr2_pdown; - ret = cpuidle_register_driver(&davinci_idle_driver); - if (ret) { - dev_err(&pdev->dev, "failed to register driver\n"); - return ret; - } - - ret = cpuidle_register_device(device); - if (ret) { - dev_err(&pdev->dev, "failed to register device\n"); - cpuidle_unregister_driver(&davinci_idle_driver); - return ret; - } - - return 0; + return cpuidle_register(&davinci_idle_driver, NULL); } static struct platform_driver davinci_cpuidle_driver = {