From patchwork Fri Apr 4 13:42:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3938231 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C5E619F1EE for ; Fri, 4 Apr 2014 13:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE4B820394 for ; Fri, 4 Apr 2014 13:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 247FC2038D for ; Fri, 4 Apr 2014 13:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473AbaDDNm6 (ORCPT ); Fri, 4 Apr 2014 09:42:58 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:63037 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbaDDNm6 (ORCPT ); Fri, 4 Apr 2014 09:42:58 -0400 Received: by mail-wg0-f46.google.com with SMTP id b13so3506990wgh.5 for ; Fri, 04 Apr 2014 06:42:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AYqyxG/B908obcuo3AXr+9XyQ5vTIKdanj401flQrDw=; b=nErdwHRYYDo/Dwlmq4yWDiYrfqWQWArPgRxJnyhksVgCKUFT/YTMOY13QKUxSxO07O 61L6EHZCc6yaMkjGupY/dEy048iWg/Bf+mM7T6GNqJpwgOtDzRr9hJE7Ky+Uo+PbFWg8 a2P9RY/HL34Y8kQTnT1K45LnFC1L86sT+RLPv2tnz/QbT9Lj523+Xyirhoz888KfgJRH Bsdq6EVoYZLZYNCSaRswSJH6Tnn/CsqzQa1Kd6cl/mIBRRZ62CZ6BZ1Nm4trV4vSRuZq Lj2GN/7DJAw8ukJkqVHfzBjw8tP+Gq/liqdDgoq8IFXG+04LLAPhv5IrrsOcj8o3RIet pmOA== X-Gm-Message-State: ALoCoQnsE6+YAY7FgdG7P1It/3Ia+h+1rdBb1Rq0sV35BV3ZT+yZ4Egbj+Rdvq/v/ry++nWJB1Z2 X-Received: by 10.194.189.201 with SMTP id gk9mr20088283wjc.13.1396618976698; Fri, 04 Apr 2014 06:42:56 -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 cu6sm2845053wjb.8.2014.04.04.06.42.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 06:42:56 -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, rjw@rjwysocki.net Subject: [PATCH V2 02/17] ARM: exynos: cpuidle: use cpuidle_register Date: Fri, 4 Apr 2014 15:42:54 +0200 Message-Id: <1396618989-2897-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396618989-2897-1-git-send-email-daniel.lezcano@linaro.org> References: <1396618989-2897-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the cpuidle generic function 'cpuidle_register'. That saves us from some extra lines of code and unneeded variables. 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; }