From patchwork Fri Sep 13 13:02:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A079220358 for ; Fri, 13 Sep 2013 13:24:29 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l4sf1164874yen.10 for ; Fri, 13 Sep 2013 06:24:29 -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: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=B3pCGurIT/zbRpg6bzy1PCQeuE64h5v2dL3J2s5mLNtdUXefHi44DDrkj0RcyrJjoB Mh+dUjTaPL1Dzqv1vbaC5a4AjqoQFFN2nNqbIUCdZQP8l7Pq9SE4iDe+IkG2kPa06k+8 85tv04vZEdn732IfNJ+D5TIpN65NaZ9Gc/aj1XSYkEQrWQkSSuMdlzHhnp5HTX0ONv+C r4FdVWr9/RFLlgqLOQLqw1vIDRdSCyPIbVPMAw/jTYQdE7A0ZhUyAuXdfCoaOAA9DlSk BhmYZiwpCBlic0fBk6a/TB1IAPMVmEdFci2GytECSBuj+9qLSDOh/7iWFVeQaNymd/1Z 2lkg== X-Gm-Message-State: ALoCoQl7XAglzuEr60j25ByqTm+hmF1KtCnTGPILxpY6M8alzaVsJJNIyd72cNywCVESQDFuWTU8 X-Received: by 10.236.163.67 with SMTP id z43mr4940121yhk.27.1379078669285; Fri, 13 Sep 2013 06:24:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.130 with SMTP id g2ls1152378qek.99.gmail; Fri, 13 Sep 2013 06:24:29 -0700 (PDT) X-Received: by 10.220.42.140 with SMTP id s12mr240309vce.33.1379078669049; Fri, 13 Sep 2013 06:24:29 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ed9si3137870vcb.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so892372vcb.40 for ; Fri, 13 Sep 2013 06:24:29 -0700 (PDT) X-Received: by 10.221.6.195 with SMTP id ol3mr197584vcb.34.1379078668969; Fri, 13 Sep 2013 06:24:28 -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 u4csp80565vcz; Fri, 13 Sep 2013 06:24:28 -0700 (PDT) X-Received: by 10.68.41.137 with SMTP id f9mr13504931pbl.148.1379078667877; Fri, 13 Sep 2013 06:24:27 -0700 (PDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id fa1si11264241pab.42.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id xb4so1222457pbc.8 for ; Fri, 13 Sep 2013 06:24:27 -0700 (PDT) X-Received: by 10.68.215.38 with SMTP id of6mr13553601pbc.14.1379078667231; Fri, 13 Sep 2013 06:24:27 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id j9sm18077124paj.18.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:26 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Stephen Warren Subject: [PATCH 180/228] cpufreq: tegra: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:32:06 +0530 Message-Id: <83bc2876bba1683251a66642e2db158deafa73c9.1379063063.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.181 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,