From patchwork Fri Feb 1 13:48:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 14402 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 A074E23E39 for ; Fri, 1 Feb 2013 13:48:34 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 3D5DDA18275 for ; Fri, 1 Feb 2013 13:48:34 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id gb23so2437341vcb.38 for ; Fri, 01 Feb 2013 05:48:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=EZUX5akdexPx00pAuI6qJqHpVIf7c8K/kRvCJ77RllQ=; b=Avr73Rq36ahvF3H5D+ixAx9hbLql+pdG9WiGOxZZM63fuxn2SZ35RjapcLIU/hw2UX iFX0VuA041/CtyPW3ZnhJ/8EWz1yHCg1oBdraUyCToyHGqmcjot1Cfhp614KFlND6A5r iI7NE/g/xdiYXdtU+8n8uRVfyf8+lKtdWsv9SCQ04xDpZDi5eVFOkS56cR1RL/DvVtU3 AyJ6adX4owOMHFGJE5MnuUUuj3wL6UhNE3NOga7jj4ewYEbYdMNUjEJXf1FK/OC96kRW Zy7R6bMTFN2QPkBkDm7lf0VEcKBtlDkZEI2bZMFr5lsX8KSCmFYbGuUmPWSTs+2KUY4H fBNQ== X-Received: by 10.59.7.65 with SMTP id da1mr7070086ved.4.1359726513733; Fri, 01 Feb 2013 05:48:33 -0800 (PST) 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.58.252.8 with SMTP id zo8csp117370vec; Fri, 1 Feb 2013 05:48:31 -0800 (PST) X-Received: by 10.194.158.100 with SMTP id wt4mr21880189wjb.37.1359726509448; Fri, 01 Feb 2013 05:48:29 -0800 (PST) Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]) by mx.google.com with ESMTPS id i8si2917433wjw.144.2013.02.01.05.48.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 05:48:29 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22a is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::22a; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::22a 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-we0-f170.google.com with SMTP id z53so3043310wey.29 for ; Fri, 01 Feb 2013 05:48:29 -0800 (PST) X-Received: by 10.180.73.116 with SMTP id k20mr2959753wiv.21.1359726499963; Fri, 01 Feb 2013 05:48:19 -0800 (PST) Received: from mai.home (AToulouse-654-1-332-150.w86-199.abo.wanadoo.fr. [86.199.219.150]) by mx.google.com with ESMTPS id bd7sm3692703wib.8.2013.02.01.05.48.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 05:48:19 -0800 (PST) From: Daniel Lezcano To: nsekhar@ti.com, khilman@ti.com Cc: patches@linaro.org, linaro-dev@lists.linaro.org, davinci-linux-open-source@linux.davincidsp.com, lenb@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 2/4] davinci: cpuidle - move code to prevent forward declaration Date: Fri, 1 Feb 2013 14:48:13 +0100 Message-Id: <1359726495-8024-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> References: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlmsmICsvYSTAXCEWELq2kXd/FFByDF2iJCFKaSjvMxS5ksDaQi+tKpnIdF7abd49VD0e7v The patch is mindless, it just moves the idle function below in the file in order to prevent forward declaration in the next patch. Signed-off-by: Daniel Lezcano --- arch/arm/mach-davinci/cpuidle.c | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index ebb8808..9438672 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c @@ -31,42 +31,6 @@ struct davinci_ops { u32 flags; }; -/* Actual code that puts the SoC in different idle states */ -static int davinci_enter_idle(struct cpuidle_device *dev, - struct cpuidle_driver *drv, - int index) -{ - struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; - struct davinci_ops *ops = cpuidle_get_statedata(state_usage); - - if (ops && ops->enter) - ops->enter(); - - index = cpuidle_wrap_enter(dev, drv, index, - arm_cpuidle_simple_enter); - - if (ops && ops->exit) - ops->exit(); - - return index; -} - -static struct cpuidle_driver davinci_idle_driver = { - .name = "cpuidle-davinci", - .owner = THIS_MODULE, - .en_core_tk_irqen = 1, - .states[0] = ARM_CPUIDLE_WFI_STATE, - .states[1] = { - .enter = davinci_enter_idle, - .exit_latency = 10, - .target_residency = 100000, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "DDR SR", - .desc = "WFI and DDR Self Refresh", - }, - .state_count = DAVINCI_CPUIDLE_MAX_STATES, -}; - static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); static void __iomem *ddr2_reg_base; static bool ddr2_pdown = false; @@ -107,6 +71,42 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = { }, }; +/* Actual code that puts the SoC in different idle states */ +static int davinci_enter_idle(struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int index) +{ + struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; + struct davinci_ops *ops = cpuidle_get_statedata(state_usage); + + if (ops && ops->enter) + ops->enter(); + + index = cpuidle_wrap_enter(dev, drv, index, + arm_cpuidle_simple_enter); + + if (ops && ops->exit) + ops->exit(); + + return index; +} + +static struct cpuidle_driver davinci_idle_driver = { + .name = "cpuidle-davinci", + .owner = THIS_MODULE, + .en_core_tk_irqen = 1, + .states[0] = ARM_CPUIDLE_WFI_STATE, + .states[1] = { + .enter = davinci_enter_idle, + .exit_latency = 10, + .target_residency = 100000, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "DDR SR", + .desc = "WFI and DDR Self Refresh", + }, + .state_count = DAVINCI_CPUIDLE_MAX_STATES, +}; + static int __init davinci_cpuidle_probe(struct platform_device *pdev) { int ret;