From patchwork Fri Oct 18 13:59:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21165 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C008202FF for ; Fri, 18 Oct 2013 14:04:34 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id uy5sf5303259obc.3 for ; Fri, 18 Oct 2013 07:04:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jmUcBL/0RzJtIvM6C5bLlZddC/NJ9z57nQiAjWRrjbU=; b=ciRXCFHFSuONbmhqzqL/jUl7G7yiuqHl6NEUx9Pz2YFrW3TwGFs/BwFC3HR9FMDwKV 0BixuvDGI/RLd+PmSQuuHpb0a72PsY/DqILcUMwX12/8fITJiL1FmPloy1wBjK4Y7N7u hOKd2YLrQ/dUCpWc9JhqpFBxiAm1dPumGM8OzFCg/8NB2K2OC9FmaxLG+n7ItR16L8S3 bIXQJgUV9IeyYhv1P9ozt8+RvsT7LYdo/+9Mh2JU+4PRC2TWtDlxRe6ZaqpTsd5JMqd7 6Y43DTXMyoWLW8Ci+pVB/wJSpdSwh0SVfVeWqVZ0ZYLafrnng41Qss0V51T+9JomOtIC Z6HQ== X-Received: by 10.182.191.8 with SMTP id gu8mr1142066obc.8.1382105074091; Fri, 18 Oct 2013 07:04:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.129.166 with SMTP id nx6ls1352486qeb.12.gmail; Fri, 18 Oct 2013 07:04:34 -0700 (PDT) X-Received: by 10.58.46.171 with SMTP id w11mr2222320vem.5.1382105073967; Fri, 18 Oct 2013 07:04:33 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id fe2si332968vcb.91.2013.10.18.07.04.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so429729vcb.7 for ; Fri, 18 Oct 2013 07:04:33 -0700 (PDT) X-Gm-Message-State: ALoCoQkwdMqxfNqn+B6JRGf3ttVlvQuaLX3cgl7G/W43BFZAkCSjLaq5lcKHPwh8BvznW8BVKLKb X-Received: by 10.220.86.69 with SMTP id r5mr2191938vcl.9.1382105073753; Fri, 18 Oct 2013 07:04:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp38213vcz; Fri, 18 Oct 2013 07:04:33 -0700 (PDT) X-Received: by 10.68.33.100 with SMTP id q4mr3169124pbi.119.1382105072659; Fri, 18 Oct 2013 07:04:32 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id ph6si1019899pbb.37.2013.10.18.07.04.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id fb1so2292385pad.3 for ; Fri, 18 Oct 2013 07:04:32 -0700 (PDT) X-Received: by 10.66.150.69 with SMTP id ug5mr3692728pab.55.1382105072260; Fri, 18 Oct 2013 07:04:32 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id qf7sm4636730pac.14.2013.10.18.07.04.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:31 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , Stephen Warren Subject: [PATCH V2 Resend 34/34] cpufreq: tegra: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:57 +0530 Message-Id: <0dd5f7232b4c4782e5434b39b399835a2eb7ea94.1382104515.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 32483ef..bd7d89c 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -150,11 +150,8 @@ static unsigned long tegra_cpu_highest_speed(void) return rate; } -static int tegra_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int tegra_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int idx; unsigned int freq; int ret = 0; @@ -165,10 +162,7 @@ static int tegra_target(struct cpufreq_policy *policy, goto out; } - cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx); - - freq = freq_table[idx].frequency; + freq = freq_table[index].frequency; target_cpu_speed[policy->cpu] = freq; @@ -238,7 +232,7 @@ static int tegra_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver tegra_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = tegra_target, + .target_index = tegra_target, .get = tegra_getspeed, .init = tegra_cpu_init, .exit = tegra_cpu_exit,