From patchwork Tue Apr 8 12:19:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 27938 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF65020553 for ; Tue, 8 Apr 2014 12:19:30 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf3764567oac.7 for ; Tue, 08 Apr 2014 05:19:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=PA1MrZhmn7OWOEOwmxSMY3IfN8dTAGSPJqzJPjzO1OA=; b=BH/KjOEHfxUROR6KGsKuWYSqY1KllIAEJ4cGNJeNosI57UaIyGgyWMbTYUlrluIlka BhINgx4EkcJACy/rEDDqTEZiPVlpMyUSwNRbYdZMzOXUL1I4yQTHs57sXQH0tpY3S7qO B1pc6J/rEtrJRhlDJT7wGHsfAgr2eHicXozvgXcbtnFR1DcUymHy9xnRqoilDj3gziBL MC4XMo3oaWjjdgKEfi/9oD78Gj9lNrpciB8ifiB9LPA9TpjoHLgrvtCz44CH/kf8sDxU ILb93YY7ZGrRIxXvHX9AwOR8PtG5440eRslHZDFfZQ/7CCfXKyhYlV1XcMPVtYx2NoUu 45WQ== X-Gm-Message-State: ALoCoQloCqjgdFP6GoNQHlWoVbB8jSwFpr6C2oV5iJaILhb1F1lUoOeW2UST9lslf7fnykMVAJ0b X-Received: by 10.42.123.66 with SMTP id q2mr1350010icr.16.1396959570101; Tue, 08 Apr 2014 05:19:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.233 with SMTP id r96ls182532qgd.98.gmail; Tue, 08 Apr 2014 05:19:29 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr2986629vcm.11.1396959569883; Tue, 08 Apr 2014 05:19:29 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id sq9si356021vdc.107.2014.04.08.05.19.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:19:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id id10so690064vcb.12 for ; Tue, 08 Apr 2014 05:19:29 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr2986623vcm.11.1396959569808; Tue, 08 Apr 2014 05:19:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp240608vcv; Tue, 8 Apr 2014 05:19:29 -0700 (PDT) X-Received: by 10.66.231.40 with SMTP id td8mr4070347pac.103.1396959568825; Tue, 08 Apr 2014 05:19:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id my2si987767pbc.154.2014.04.08.05.19.28; Tue, 08 Apr 2014 05:19:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756522AbaDHMT1 (ORCPT + 9 others); Tue, 8 Apr 2014 08:19:27 -0400 Received: from mail-we0-f177.google.com ([74.125.82.177]:37836 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756377AbaDHMT1 (ORCPT ); Tue, 8 Apr 2014 08:19:27 -0400 Received: by mail-we0-f177.google.com with SMTP id u57so841024wes.22 for ; Tue, 08 Apr 2014 05:19:25 -0700 (PDT) X-Received: by 10.180.8.40 with SMTP id o8mr31636476wia.25.1396959565158; Tue, 08 Apr 2014 05:19:25 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-451-172.w83-205.abo.wanadoo.fr. [83.205.74.172]) by mx.google.com with ESMTPSA id u1sm3000063wjx.16.2014.04.08.05.19.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:19:24 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, t.figa@samsung.com, linaro-kernel@lists.linaro.org, b.zolnierkie@samsung.com, sachin.kamat@linaro.org, viresh.kumar@linaro.org, rjw@rjwysocki.net Subject: [PATCH V3 02/17] ARM: exynos: cpuidle: use cpuidle_register Date: Tue, 8 Apr 2014 14:19:24 +0200 Message-Id: <1396959579-18268-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396959579-18268-1-git-send-email-daniel.lezcano@linaro.org> References: <1396959579-18268-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use the cpuidle generic function 'cpuidle_register'. That saves us from some extra lines of code and unneeded variables. A side effect of this change is a bug fix where before the cpuidle driver was registered for each_online_cpu and now it is for each_possible_cpu. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar Reviewed-by: Bartlomiej Zolnierkiewicz --- arch/arm/mach-exynos/cpuidle.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 9623a05..b7cd75b 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -59,8 +59,6 @@ #define PWR_CTRL2_CORE2_UP_RATIO (1 << 4) #define PWR_CTRL2_CORE1_UP_RATIO (1 << 0) -static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device); - /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ static void exynos4_set_wakeupmask(void) { @@ -211,8 +209,7 @@ static struct cpuidle_driver exynos4_idle_driver = { static int exynos_cpuidle_probe(struct platform_device *pdev) { - int cpu_id, ret; - struct cpuidle_device *device; + int ret; if (soc_is_exynos5250()) exynos5_core_down_clk(); @@ -220,23 +217,12 @@ static int exynos_cpuidle_probe(struct platform_device *pdev) if (soc_is_exynos5440()) exynos4_idle_driver.state_count = 1; - ret = cpuidle_register_driver(&exynos4_idle_driver); + ret = cpuidle_register(&exynos4_idle_driver, NULL); if (ret) { dev_err(&pdev->dev, "failed to register cpuidle driver\n"); return ret; } - for_each_online_cpu(cpu_id) { - device = &per_cpu(exynos4_cpuidle_device, cpu_id); - device->cpu = cpu_id; - - ret = cpuidle_register_device(device); - if (ret) { - dev_err(&pdev->dev, "failed to register cpuidle device\n"); - return ret; - } - } - return 0; }