From patchwork Mon Mar 25 17:55:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15619 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 C774823E2C for ; Mon, 25 Mar 2013 17:56:09 +0000 (UTC) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by fiordland.canonical.com (Postfix) with ESMTP id 64EBAA194CA for ; Mon, 25 Mar 2013 17:56:09 +0000 (UTC) Received: by mail-ve0-f180.google.com with SMTP id c13so3110238vea.25 for ; Mon, 25 Mar 2013 10:56:08 -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=dZRC5It2onR+064omvtl6zPwO6kQRsvn7QCtP8OMG3E=; b=JRwI7Hmhmjiok4XP1GIl7xd2wQo+K0uMigd//iUAqsUk1zTwu/MIVbPewlgMRPw1AZ mjLbh3VNUctUf7s+svU8F4m7lgFFqufI3HCfSQlE/MrUjKzM6B84QkLO+AzJRn6/ZoZw jGSFtvhssxP3b2gMJ4qwIV8Cps2GGhs0U3TJBBtkmyii2MdFYgz3aWVQV0qTz+cHVyK8 XA5bZGUvSg/Rc7Od7RMYGhR26uFZJi9SYoOQQZs4JFZUtJ4Tve9J6D0QmgBRLVfC+qVl hbFd4shEz/4qWMXAvThvykTVNn7M8iKrKd/BhhGobdfwyxWirIJ8jUj+FhjXcF5RL2G6 nNpA== X-Received: by 10.220.225.200 with SMTP id it8mr16666926vcb.39.1364234168940; Mon, 25 Mar 2013 10:56:08 -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 cg12csp37244ved; Mon, 25 Mar 2013 10:56:07 -0700 (PDT) X-Received: by 10.194.71.241 with SMTP id y17mr19743206wju.28.1364234167510; Mon, 25 Mar 2013 10:56:07 -0700 (PDT) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by mx.google.com with ESMTPS id uc6si5387592wjc.73.2013.03.25.10.56.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:07 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.46 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.46 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-f46.google.com with SMTP id fg15so877774wgb.25 for ; Mon, 25 Mar 2013 10:56:07 -0700 (PDT) X-Received: by 10.194.143.50 with SMTP id sb18mr19691660wjb.44.1364234167111; Mon, 25 Mar 2013 10:56:07 -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.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:56:05 -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 10/15] ARM: OMAP3: cpuidle: use init/exit common routine Date: Mon, 25 Mar 2013 18:55:35 +0100 Message-Id: <1364234140-514-11-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: ALoCoQn6r/n2DRuq2J+QHfrWD0tc+Q4eWabpwx4oPs6RfnBDPGNZ5s/Q1rGqdIpPaGGOasfsdrjw Remove the duplicate code and use the arm cpuidle driver's common code for initialization. Signed-off-by: Daniel Lezcano --- arch/arm/mach-omap2/cpuidle34xx.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 80392fc..b5a0ba1 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "powerdomain.h" #include "clockdomain.h" @@ -271,8 +272,6 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, return ret; } -static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); - static struct cpuidle_driver omap3_idle_driver = { .name = "omap3_idle", .owner = THIS_MODULE, @@ -348,8 +347,6 @@ static struct cpuidle_driver omap3_idle_driver = { */ int __init omap3_idle_init(void) { - struct cpuidle_device *dev; - mpu_pd = pwrdm_lookup("mpu_pwrdm"); core_pd = pwrdm_lookup("core_pwrdm"); per_pd = pwrdm_lookup("per_pwrdm"); @@ -358,16 +355,5 @@ int __init omap3_idle_init(void) if (!mpu_pd || !core_pd || !per_pd || !cam_pd) return -ENODEV; - cpuidle_register_driver(&omap3_idle_driver); - - dev = &per_cpu(omap3_idle_dev, smp_processor_id()); - dev->cpu = 0; - - if (cpuidle_register_device(dev)) { - printk(KERN_ERR "%s: CPUidle register device failed\n", - __func__); - return -EIO; - } - - return 0; + return arm_cpuidle_init(&omap3_idle_driver); }