From patchwork Fri Sep 13 13:01:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20220 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF2FD20358 for ; Fri, 13 Sep 2013 13:22:47 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf1231587qea.11 for ; Fri, 13 Sep 2013 06:22:47 -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=/DBfjyAyFp071gZdqMO5j0W9NnnxKGcP4RtfmW8cWZQ=; b=buP9HfGEaS1Qylxqj19m0r8HeYmXiylp4xSaW7y7m+Z1dxBUmK4D3hLg0ztSmPcV3m lBYFuNSYX6FIygY+ysRsBwImbXYFny5OznzMYmf5HaY2s0FUzXn4bcArb1YJFmYPKU/K EncDdjpMl76C7NBnj3HLr2UZhFKwbS0+Y89NkA3KvlG2rmJzrXDJ+gQm1s7217+guksu N05eMytehEdl05ai/uN5omgrPfgRy4KDFjBkN0X00WB4DrIvlI6jf0IO54s/5zb/c/zv ySWretdKjxgcOlWFNaiktAT25IYAj8oaTbvYXiqtrZDHY/OQ33/FWa+QKxcL1j3H7Lp8 caLw== X-Gm-Message-State: ALoCoQn5b4IFnVucd1oEM51YnBCijePbG8l8WLQc+WH0vh6Hkl0uxHrCnyhMXDkq5kN8L6eZznQj X-Received: by 10.236.172.34 with SMTP id s22mr4944314yhl.25.1379078567611; Fri, 13 Sep 2013 06:22:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.70.228 with SMTP id p4ls1097965qeu.43.gmail; Fri, 13 Sep 2013 06:22:47 -0700 (PDT) X-Received: by 10.58.46.229 with SMTP id y5mr4557087vem.15.1379078567339; Fri, 13 Sep 2013 06:22:47 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id lr1si3131768vcb.19.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id db12so949786veb.14 for ; Fri, 13 Sep 2013 06:22:47 -0700 (PDT) X-Received: by 10.221.6.195 with SMTP id ol3mr190611vcb.34.1379078567246; Fri, 13 Sep 2013 06:22:47 -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 u4csp80469vcz; Fri, 13 Sep 2013 06:22:46 -0700 (PDT) X-Received: by 10.68.219.33 with SMTP id pl1mr13307080pbc.147.1379078566168; Fri, 13 Sep 2013 06:22:46 -0700 (PDT) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id t8si7465114pbe.128.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id md4so1218225pbc.30 for ; Fri, 13 Sep 2013 06:22:45 -0700 (PDT) X-Received: by 10.66.175.133 with SMTP id ca5mr15604837pac.40.1379078565712; Fri, 13 Sep 2013 06:22:45 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id pu5sm18056176pac.21.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:45 -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 , "David S. Miller" Subject: [PATCH 166/228] cpufreq: p4: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:52 +0530 Message-Id: <11f01132284a3949c269ec4cb8c9e7342a2f37c4.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.128.169 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: David S. Miller Signed-off-by: Viresh Kumar --- drivers/cpufreq/p4-clockmod.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c index 6164c1c..3c23053 100644 --- a/drivers/cpufreq/p4-clockmod.c +++ b/drivers/cpufreq/p4-clockmod.c @@ -105,23 +105,13 @@ static struct cpufreq_frequency_table p4clockmod_table[] = { }; -static int cpufreq_p4_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int cpufreq_p4_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int newstate = DC_RESV; struct cpufreq_freqs freqs; int i; - if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0], - target_freq, relation, &newstate)) - return -EINVAL; - freqs.old = cpufreq_p4_get(policy->cpu); - freqs.new = stock_freq * p4clockmod_table[newstate].driver_data / 8; - - if (freqs.new == freqs.old) - return 0; + freqs.new = stock_freq * p4clockmod_table[index].driver_data / 8; /* notifiers */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); @@ -131,7 +121,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, * Developer's Manual, Volume 3 */ for_each_cpu(i, policy->cpus) - cpufreq_p4_setdc(i, p4clockmod_table[newstate].driver_data); + cpufreq_p4_setdc(i, p4clockmod_table[index].driver_data); /* notifiers */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); @@ -255,7 +245,7 @@ static unsigned int cpufreq_p4_get(unsigned int cpu) static struct cpufreq_driver p4clockmod_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = cpufreq_p4_target, + .target_index = cpufreq_p4_target, .init = cpufreq_p4_cpu_init, .exit = cpufreq_generic_exit, .get = cpufreq_p4_get,