From patchwork Fri Apr 12 12:36:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16110 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6AF8E26EB0 for ; Fri, 12 Apr 2013 12:37:30 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id p43sf3066705wea.4 for ; Fri, 12 Apr 2013 05:37:06 -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=NgEzI05uKwSQUGJC7/HZnec019J84VVnPzOhnMXsMw0=; b=S9+ZGDa+FA0eJE2B10+0jhx7M9TPR1vO6pWTyP/VxDK0VjBT6NQaTVE0n0xYx7GyvW Ml5asocWowcvhrmU/v3/k0g0Ky3kimtmNXreCIf/65QZePBDNqdL7D7D3RTzwROSnHvK h+u0muUQpqfw0fLGDvhlzcfYajYHmJ6H2pWE22IZnFps0CHKlRXlTw8blGVmtpscXHNm 9Uut6Ts08SxNmzwSjqjKbCmc0JnM3GyJmsYqPxzYkuy+f4BMpUtixjqew+622ZXIigBa dXYS+8v1blFTJVNevaSn/NFSCJ3we8mLjQGzDLZVNIjR5BwPCUTEmTfRm1g65V5rzn+x qQLQ== X-Received: by 10.180.198.210 with SMTP id je18mr850194wic.1.1365770226162; Fri, 12 Apr 2013 05:37:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.182.230 with SMTP id eh6ls432835wic.14.canary; Fri, 12 Apr 2013 05:37:06 -0700 (PDT) X-Received: by 10.180.73.6 with SMTP id h6mr3716947wiv.27.1365770226104; Fri, 12 Apr 2013 05:37:06 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id gf7si3022710wjb.85.2013.04.12.05.37.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:37:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id 15so2381336vea.1 for ; Fri, 12 Apr 2013 05:37:05 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr7026997vdj.75.1365770225009; Fri, 12 Apr 2013 05:37:05 -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 nf2csp64104veb; Fri, 12 Apr 2013 05:37:04 -0700 (PDT) X-Received: by 10.180.11.148 with SMTP id q20mr3768445wib.18.1365770224073; Fri, 12 Apr 2013 05:37:04 -0700 (PDT) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx.google.com with ESMTPS id hs2si797756wib.68.2013.04.12.05.37.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:37:04 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.52 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.52; Received: by mail-wg0-f52.google.com with SMTP id n12so2671768wgh.7 for ; Fri, 12 Apr 2013 05:37:03 -0700 (PDT) X-Received: by 10.194.81.40 with SMTP id w8mr17173572wjx.14.1365770223572; Fri, 12 Apr 2013 05:37:03 -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.37.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 05:37:02 -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 17/19] ARM: kirkwood: cpuidle: use init/exit common routine Date: Fri, 12 Apr 2013 14:36:03 +0200 Message-Id: <1365770165-27096-18-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: ALoCoQmEfvKVmLJrHNP+qkxe0mwwXeC8CmosS9hJL4blacLyk2Ctp6cHBURTqYiaiBKV+l1P4Qio X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 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 duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano Tested-by: Andrew Lunn --- 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; }