From patchwork Tue Aug 13 13:32:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843746 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6BB289F239 for ; Tue, 13 Aug 2013 15:02:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C24A820514 for ; Tue, 13 Aug 2013 15:02:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 067C22050C for ; Tue, 13 Aug 2013 15:02:37 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Epx-0002hO-Pb; Tue, 13 Aug 2013 13:40:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Epm-0008UL-PM; Tue, 13 Aug 2013 13:40:26 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EnJ-0008FK-Cq for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:37:54 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz10so8885011pad.16 for ; Tue, 13 Aug 2013 06:37:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=8WOD65/3WRCuVYPHiI22AvJoDJuCi5/ZMoW8CTbH2CA=; b=oBApLrK1a2b3qGOx9mXrsD/UIiCl1eQfKRpXzYByL4ho6TnBSxZ0IRLN0fc5+LYc0L AwCAGN6L7sK9selbCr3OKYlQTmxHf1GHSm15MAV8aHMTCSPpSUrw8B41fSKF6Wg8QtOy 188ojdcp7SWgH9QmuIqAxPCFx9imw8Vl4lGbn9POlVnbLD17dD6oOn6xfgIS/wpE5LTh ewrOMHrxOxb6AinMofAARfI2R8Kgj19oS2MJzCrdtzJUz9CaxuKgqiSbqqMiJb+1XU6D RdYEP43bX06jQIwocMrnTDwE36bK5nR8sLbzxfrGRnYTMWOOpSqf91NgwlYsgh8M8Twh T63Q== X-Gm-Message-State: ALoCoQlyLjyBm6AiF7d9+4EVPU8j3a9l0K1JrVz+6V5IYnkIPljARC/m5LTwThVXG2VGEQblqJSR X-Received: by 10.68.251.234 with SMTP id zn10mr1823463pbc.188.1376401051887; Tue, 13 Aug 2013 06:37:31 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ht5sm43997513pbb.29.2013.08.13.06.37.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:31 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 35/35] cpufreq: tegra: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:48 +0530 Message-Id: <8becd7a6b5383426e35e89d108dbc9bb8ee17655.1376392602.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130813_093753_567210_8AD86F91 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, Stephen Warren , linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 affb294..ee2cf8f3 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; @@ -234,7 +228,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,