From patchwork Thu Apr 10 09:55:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 28135 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B17E20671 for ; Thu, 10 Apr 2014 09:55:48 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q108sf6931168qgd.11 for ; Thu, 10 Apr 2014 02:55:48 -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=NzzRxGwttNd5RLhlvJ1NrEawzLswZQUBm0UyBTg7+n8=; b=NglVoiJQGbNUwRvkhiKDUGAPNTVqPd/VYb7dGJiOoFJ1I+kWZkk4xKjvIAZBJ7HCUe UatLDeCB0HxV1XTHnL3QM2PFtB/GQXgRFcGQSfPoDRBmaaDGk51YXglvhNAPcV4tQTGu 4HhmtbdZMDJjTF6TXAMXyg9UTMAXoS/i2EVqzgGfUDgrKUUoj3ctibO07gL9WrXLatH8 nygukqUUssGEj3Sk0J5x+KNxuaz2AO31uIfU9nNsYaSeA24kgshWyiSlotpHeeXWezYG oSwvnV4506uCuobSZ7n99HrdaBkyOsShxy0CG/v0nCQm0rRH2f8tbqQXzNwnQPgn040X QkPQ== X-Gm-Message-State: ALoCoQmppD7RFa2U0lZzcDV8+iHHhnF1icDDOulgckxeQQYH+XRWGpz9xDbTeIyzXQfNZX/+2uBp X-Received: by 10.236.197.39 with SMTP id s27mr7025553yhn.36.1397123748420; Thu, 10 Apr 2014 02:55:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.116 with SMTP id z107ls1116211qge.37.gmail; Thu, 10 Apr 2014 02:55:48 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr687060vcb.23.1397123748210; Thu, 10 Apr 2014 02:55:48 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id rn1si607836vec.78.2014.04.10.02.55.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 02:55:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id la4so3161593vcb.17 for ; Thu, 10 Apr 2014 02:55:48 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr13779408vcb.0.1397123748122; Thu, 10 Apr 2014 02:55:48 -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.221.72 with SMTP id ib8csp45012vcb; Thu, 10 Apr 2014 02:55:47 -0700 (PDT) X-Received: by 10.67.2.34 with SMTP id bl2mr18640563pad.58.1397123747445; Thu, 10 Apr 2014 02:55:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xe4si1873677pbc.456.2014.04.10.02.55.46; Thu, 10 Apr 2014 02:55:46 -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 S965558AbaDJJzo (ORCPT + 9 others); Thu, 10 Apr 2014 05:55:44 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34216 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965638AbaDJJzh (ORCPT ); Thu, 10 Apr 2014 05:55:37 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so4667432wib.5 for ; Thu, 10 Apr 2014 02:55:35 -0700 (PDT) X-Received: by 10.180.20.176 with SMTP id o16mr41836431wie.7.1397123735700; Thu, 10 Apr 2014 02:55:35 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-377-242.w86-199.abo.wanadoo.fr. [86.199.232.242]) by mx.google.com with ESMTPSA id hu7sm15690125wib.10.2014.04.10.02.55.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 02:55:35 -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 V4 02/20] ARM: exynos: cpuidle: Use cpuidle_register Date: Thu, 10 Apr 2014 11:55:33 +0200 Message-Id: <1397123751-1957-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397123751-1957-1-git-send-email-daniel.lezcano@linaro.org> References: <1397123751-1957-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.172 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 Reviewed-by: Tomasz Figa --- 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; }