From patchwork Mon May 14 14:06:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8594 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 0451723EB5 for ; Mon, 14 May 2012 14:06:23 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id C4BC3A185ED for ; Mon, 14 May 2012 14:06:22 +0000 (UTC) Received: by yhpp61 with SMTP id p61so5374939yhp.11 for ; Mon, 14 May 2012 07:06:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+DIav8PjD5yQV+uvjqfcAyDXl/jnsBXQ8iPaaPOS43Q=; b=GKKk6B2uGt22sFrN2mzS2t9IvXooaKv8Mb6csoTLFIjBIanhnjhLs+qc6RPCH6YTyy qDCsVQ9G7F3ingz0eMcxSSJnR+Xbf/ni3s88AK335S0tEDvATp2ql5DjaVcHCHeLKMRw QOizWU02GisP5YsO3LWkOlZfZu81M16DOfpwmLBqN1Em9QALfqjLfjLT1E3oAT3N+hJo YRvh3zxUihNiJWfpjbhkxsDziRlISxls6OdQ/Ppz7pkK2E45mEsuixyzHqHslGBciyCp fvlYDcsYaLxYhxKUHaS9JcgWw+AcXRmzOPH6eLNagpkomvpWQTGUYDfSoMlZKh+vXnaj QnnA== Received: by 10.50.85.163 with SMTP id i3mr4234911igz.57.1337004381944; Mon, 14 May 2012 07:06:21 -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.231.35.72 with SMTP id o8csp345268ibd; Mon, 14 May 2012 07:06:21 -0700 (PDT) Received: by 10.213.153.3 with SMTP id i3mr1454247ebw.138.1337004380651; Mon, 14 May 2012 07:06:20 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id d3si12954085wed.115.2012.05.14.07.06.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 07:06:20 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-f50.google.com with SMTP id ds11so4849834wgb.31 for ; Mon, 14 May 2012 07:06:20 -0700 (PDT) Received: by 10.180.99.195 with SMTP id es3mr20429537wib.12.1337004380064; Mon, 14 May 2012 07:06:20 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-63-91.w92-134.abo.wanadoo.fr. [92.134.214.91]) by mx.google.com with ESMTPS id j3sm55355995wiw.1.2012.05.14.07.06.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 07:06:19 -0700 (PDT) From: Daniel Lezcano To: ben-linux@fluff.org, kgene.kim@samsung.com, broonie@opensource.wolfsonmicro.com Cc: linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, patches@linaro.org, linux-samsung-soc@vger.kernel.org, heiko@sntech.de Subject: [PATCH 1/2] ARM: s3c64xx: cpuidle - declare the states with the new api Date: Mon, 14 May 2012 16:06:16 +0200 Message-Id: <1337004377-17732-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1337004377-17732-1-git-send-email-daniel.lezcano@linaro.org> References: <1337004377-17732-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmyD5FJHyMDdxJSkXs55V/b2RVFA5wqRHqCXCA6Zui/vCYO4NYIRUd5IZ5bxJMNTbbCm8iR The states are now part of the cpuidle_driver structure, so we can declare the states in this structure directly. That saves us an extra variable declaration and a memcpy. Signed-off-by: Daniel Lezcano Tested-by: Mark Brown --- arch/arm/mach-s3c64xx/cpuidle.c | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c index 179460f..2750e54 100644 --- a/arch/arm/mach-s3c64xx/cpuidle.c +++ b/arch/arm/mach-s3c64xx/cpuidle.c @@ -51,33 +51,28 @@ static int s3c64xx_enter_idle(struct cpuidle_device *dev, return index; } -static struct cpuidle_state s3c64xx_cpuidle_set[] = { - [0] = { - .enter = s3c64xx_enter_idle, - .exit_latency = 1, - .target_residency = 1, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "IDLE", - .desc = "System active, ARM gated", - }, -}; +static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device); static struct cpuidle_driver s3c64xx_cpuidle_driver = { - .name = "s3c64xx_cpuidle", - .owner = THIS_MODULE, - .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), -}; - -static struct cpuidle_device s3c64xx_cpuidle_device = { - .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), + .name = "s3c64xx_cpuidle", + .owner = THIS_MODULE, + .states = { + { + .enter = s3c64xx_enter_idle, + .exit_latency = 1, + .target_residency = 1, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "IDLE", + .desc = "System active, ARM gated", + }, + }, + .state_count = 1, }; static int __init s3c64xx_init_cpuidle(void) { int ret; - memcpy(s3c64xx_cpuidle_driver.states, s3c64xx_cpuidle_set, - sizeof(s3c64xx_cpuidle_set)); cpuidle_register_driver(&s3c64xx_cpuidle_driver); ret = cpuidle_register_device(&s3c64xx_cpuidle_device);