From patchwork Fri Apr 4 07:47:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 27771 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DD652054B for ; Fri, 4 Apr 2014 07:47:55 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf5379239qge.0 for ; Fri, 04 Apr 2014 00:47:55 -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=AgoGRbdAPlP9+WrhDmSM+6HjPb5gU8HjhP2EWSL3T0U=; b=UdVfyBoHKUbdHF7CczovYOL119hO3dfxvoIaMxmce4VvrozdGwFVsC+7hqrnImCjRq qEVeMyx7V5bA/4YAxnYXuI6oqYmNYXBKiGHQESvkReCtzsbZ0qyZm18BrPwvp0qKqY1b Rbn+Z0vQCYBiJlMspNmLZN7J8VvlGJgl/UQsLvJv/g++Lo6A87BcyJkGbmO5BxS3rUm7 iw85OIAFebCmCThf68WCTRYPSsR7mNAIPRmte0M8sFc+I7/Z+nnoC946aU43cE4zL0Ex Q5mcPoHNDry3yWVkK3hy2FQHF2kvBid6U2IyU4uS3WaWJrgPQ4Tpp3AAKouP4QGFoVs7 dacA== X-Gm-Message-State: ALoCoQnUYJ6ZkLn6GGk7WljjmhRwB9xkJwizHYA8PYdyfyvAP2nPvsJuaFdPzeWRnR9IYH6+9unH X-Received: by 10.236.94.238 with SMTP id n74mr5713622yhf.27.1396597675415; Fri, 04 Apr 2014 00:47:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls961337qgm.94.gmail; Fri, 04 Apr 2014 00:47:55 -0700 (PDT) X-Received: by 10.53.1.69 with SMTP id be5mr172403vdd.27.1396597675349; Fri, 04 Apr 2014 00:47:55 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id gs7si1651842vdc.182.2014.04.04.00.47.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 00:47:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so2873207vcb.34 for ; Fri, 04 Apr 2014 00:47:55 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr394815vcb.22.1396597675279; Fri, 04 Apr 2014 00:47:55 -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 v8csp92797vcv; Fri, 4 Apr 2014 00:47:54 -0700 (PDT) X-Received: by 10.68.100.1 with SMTP id eu1mr13336023pbb.36.1396597674278; Fri, 04 Apr 2014 00:47:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iw3si4270530pac.96.2014.04.04.00.47.53; Fri, 04 Apr 2014 00:47:53 -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 S1752098AbaDDHrw (ORCPT + 9 others); Fri, 4 Apr 2014 03:47:52 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:40110 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbaDDHrv (ORCPT ); Fri, 4 Apr 2014 03:47:51 -0400 Received: by mail-wi0-f182.google.com with SMTP id d1so681310wiv.15 for ; Fri, 04 Apr 2014 00:47:50 -0700 (PDT) X-Received: by 10.181.13.11 with SMTP id eu11mr2254928wid.30.1396597670378; Fri, 04 Apr 2014 00:47:50 -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 t1sm3028163wia.1.2014.04.04.00.47.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 00:47:49 -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 02/17] ARM: exynos: cpuidle: use cpuidle_register Date: Fri, 4 Apr 2014 09:47:48 +0200 Message-Id: <1396597683-6969-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396597683-6969-1-git-send-email-daniel.lezcano@linaro.org> References: <1396597683-6969-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.175 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. Signed-off-by: Daniel Lezcano --- 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 bd2142a..b9e9a90 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -60,8 +60,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) { @@ -212,8 +210,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(); @@ -221,23 +218,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; }