From patchwork Mon Feb 4 12:01:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 14524 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 A14E923F96 for ; Mon, 4 Feb 2013 12:01:55 +0000 (UTC) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by fiordland.canonical.com (Postfix) with ESMTP id 30368A19370 for ; Mon, 4 Feb 2013 12:01:55 +0000 (UTC) Received: by mail-ve0-f181.google.com with SMTP id d10so4648625vea.12 for ; Mon, 04 Feb 2013 04:01:54 -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=DzAHYz3BINJaxBFVmOOy/O76zSB7U2aHNceWZfO5LHs=; b=px3LA4abPAOW9u0JaeCxYkdotRW75EYtFddAWkCTPtL8+7l7PnTKTRdsmrIhydlgWV tcrjfvR+Mtagy7es7hfRRx80Sy0R5vsAVlI5RLeo+ibe+u2rjU2SP4GCcSFT5P3CJZOh 4kwV5nl6xF5Ug6Phjry4p6x+zjVTy8rWo16scVxfnQQ6Yy0SKJ+SiI3f6BOH6vNZzjSJ wpNvkV+/xOMXYuDTuBWLX5PBoLWmj/gyRFIFWVlBHqIo7KqD8JpPZmckyH8GvfvOx8JT jQXTFjlfb08HDbZ0RMwPZjqEKgdEJcc9mGZYaESF5KoqGAWza/+x1FJw07fICBjk75mM MEZw== X-Received: by 10.52.66.168 with SMTP id g8mr19475079vdt.27.1359979314687; Mon, 04 Feb 2013 04:01:54 -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 zo8csp83312vec; Mon, 4 Feb 2013 04:01:54 -0800 (PST) X-Received: by 10.194.57.206 with SMTP id k14mr34591451wjq.26.1359979313824; Mon, 04 Feb 2013 04:01:53 -0800 (PST) Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by mx.google.com with ESMTPS id q9si1768686wjw.248.2013.02.04.04.01.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:53 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.54 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.54 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-f54.google.com with SMTP id fm10so4757203wgb.9 for ; Mon, 04 Feb 2013 04:01:53 -0800 (PST) X-Received: by 10.194.76.165 with SMTP id l5mr34515729wjw.14.1359979313441; Mon, 04 Feb 2013 04:01:53 -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 j9sm12967916wia.5.2013.02.04.04.01.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:51 -0800 (PST) From: Daniel Lezcano To: khilman@deeprootsystems.com, nsekhar@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][V2] davinci: cpuidle - move code to prevent forward declaration Date: Mon, 4 Feb 2013 13:01:42 +0100 Message-Id: <1359979304-8715-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> References: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQk5kb9J8PsmIC61O1Cuo4quf4oxzyzq3t6CqaE8Zgz98pp5Cjak+ugHD/FiCk7L2G+hARPB 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 Acked-by: Sekhar Nori --- 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 5fbd470..697febe 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; @@ -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;