From patchwork Wed Apr 10 14:22:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 16032 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F01B227740 for ; Wed, 10 Apr 2013 14:23:47 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id 11sf795669vbf.1 for ; Wed, 10 Apr 2013 07:23:28 -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=PAEiD/lfNYtUGrxjN3lMp/sfcv7HjbqJbFw5P1xfsEQWGz6XRlu+8Fcom7jkpF3LQw FQ/ahzqM0Z5qAAdt2z6+hDiaclnI9HJKUZkUhvKaBGCLy8DBILrU3lAOVIAJgOvax+an 2ZiEqVVtWy6bDanuN7GQjIeXVLD69Xx5P9zEiCO0AkfdloyCqJKlcScNJ2yVFHRVyj3B T9Z0MHr3iCt+gsm2sxgIlGU9Vg9DWoQpyUPEfVFbHbxyGGgqsSIlaz01VzvU6RlTtW0I FNkppRs0B94g4GTYZf6Xm+ng4S0ObngIdc2eqJftPaXqV5B5h9hweH+KitQqqNgcCUQf /8YQ== X-Received: by 10.236.170.7 with SMTP id o7mr1218891yhl.1.1365603808723; Wed, 10 Apr 2013 07:23:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.34 with SMTP id a2ls262047qen.73.gmail; Wed, 10 Apr 2013 07:23:28 -0700 (PDT) X-Received: by 10.52.97.8 with SMTP id dw8mr1399370vdb.91.1365603808561; Wed, 10 Apr 2013 07:23:28 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id p10si118075vcj.18.2013.04.10.07.23.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id m16so408949vca.39 for ; Wed, 10 Apr 2013 07:23:28 -0700 (PDT) X-Received: by 10.52.25.72 with SMTP id a8mr1422835vdg.47.1365603808228; Wed, 10 Apr 2013 07:23:28 -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.85.136 with SMTP id h8csp107502vez; Wed, 10 Apr 2013 07:23:27 -0700 (PDT) X-Received: by 10.180.188.141 with SMTP id ga13mr27508577wic.9.1365603803006; Wed, 10 Apr 2013 07:23:23 -0700 (PDT) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [2a00:1450:400c:c05::22b]) by mx.google.com with ESMTPS id fb16si8101472wid.37.2013.04.10.07.23.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:22 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22b is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c05::22b; Received: by mail-wi0-f171.google.com with SMTP id hn17so4867602wib.10 for ; Wed, 10 Apr 2013 07:23:22 -0700 (PDT) X-Received: by 10.181.11.164 with SMTP id ej4mr3840674wid.29.1365603797820; Wed, 10 Apr 2013 07:23:17 -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.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 07:23:17 -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: [PATCH 16/18] ARM: kirkwood: cpuidle: use init/exit common routine Date: Wed, 10 Apr 2013 16:22:21 +0200 Message-Id: <1365603743-5618-17-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: ALoCoQkEe3BNp3282WX08bKi/Q++DAJehZAh9lB1eqlRODyYk4dugiZcUgwvpkWOdqlOSnYdb2LU X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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 --- 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; }