From patchwork Fri Sep 13 13:01:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20218 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4345C20358 for ; Fri, 13 Sep 2013 13:22:24 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gd11sf1206784vcb.4 for ; Fri, 13 Sep 2013 06:22:24 -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=jyh5ton767fi0nM8K6ACPgez3/KxG3vfvtyrr9zLlrY=; b=CPThon0h84I/2cN9AaAr3IVsggC3x2nNkAfN/kRI4t8zsWXEnrIEFyuLbmS1zoOzZH yTH0mOiV0EtPdS3wsG+Wk8o6j04M/IJY806VZIx8mhDU/WFuuv29vESHg6ove7zEgD0j /tLmpvBz/t/ypO3EqQLwElJNnYRbbEKgn93CAPgeUdPGF2FECoqjSrBkv/sMq8wtHfuH A78rS8sVVYkCS4MTcpU6a09UooT7TJxnfdrVoQbStfHg5sFVo2HtppX7ZQLyXrclRqXy Jo6SC77WGHmhqhr8QYfwAxTxxJYffTLxHvuH/POalwt9WvkCS7H8SkLnY0X+192BwKLM Rmcg== X-Gm-Message-State: ALoCoQkWiiNM1p8W0LZPJTAFb+mIYj4JfCDBKvUiFRfIzv/LEWMJWLRFBm+5oGYw8YkEXKqELLoR X-Received: by 10.236.18.196 with SMTP id l44mr691498yhl.52.1379078543973; Fri, 13 Sep 2013 06:22:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.49 with SMTP id f17ls1168119qey.33.gmail; Fri, 13 Sep 2013 06:22:23 -0700 (PDT) X-Received: by 10.58.218.225 with SMTP id pj1mr1687655vec.24.1379078543732; Fri, 13 Sep 2013 06:22:23 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id vv9si3107418vec.119.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so885296vbf.38 for ; Fri, 13 Sep 2013 06:22:23 -0700 (PDT) X-Received: by 10.58.208.130 with SMTP id me2mr11934029vec.13.1379078543643; Fri, 13 Sep 2013 06:22:23 -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 u4csp80448vcz; Fri, 13 Sep 2013 06:22:23 -0700 (PDT) X-Received: by 10.68.200.9 with SMTP id jo9mr13246038pbc.120.1379078542803; Fri, 13 Sep 2013 06:22:22 -0700 (PDT) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id z1si11211231pab.189.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so1230408pbb.33 for ; Fri, 13 Sep 2013 06:22:22 -0700 (PDT) X-Received: by 10.66.146.42 with SMTP id sz10mr15529377pab.100.1379078542225; Fri, 13 Sep 2013 06:22:22 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id ia5sm11721599pbc.42.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:21 -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 , Dmitry Eremin-Solenikov Subject: [PATCH 164/228] cpufreq: maple: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:50 +0530 Message-Id: <9bd91be388c26d887c6e5ba7974d77602a72cead.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.212.51 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: Dmitry Eremin-Solenikov Signed-off-by: Viresh Kumar --- drivers/cpufreq/maple-cpufreq.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index eb1e176..4e2da08 100644 --- a/drivers/cpufreq/maple-cpufreq.c +++ b/drivers/cpufreq/maple-cpufreq.c @@ -131,26 +131,18 @@ static int maple_scom_query_freq(void) */ static int maple_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { - unsigned int newstate = 0; struct cpufreq_freqs freqs; int rc; - if (cpufreq_frequency_table_target(policy, maple_cpu_freqs, - target_freq, relation, &newstate)) - return -EINVAL; - - if (maple_pmode_cur == newstate) - return 0; - mutex_lock(&maple_switch_mutex); freqs.old = maple_cpu_freqs[maple_pmode_cur].frequency; - freqs.new = maple_cpu_freqs[newstate].frequency; + freqs.new = maple_cpu_freqs[index].frequency; cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - rc = maple_scom_switch_freq(newstate); + rc = maple_scom_switch_freq(index); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); mutex_unlock(&maple_switch_mutex); @@ -173,7 +165,7 @@ static struct cpufreq_driver maple_cpufreq_driver = { .flags = CPUFREQ_CONST_LOOPS, .init = maple_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, - .target = maple_cpufreq_target, + .target_index = maple_cpufreq_target, .get = maple_cpufreq_get_speed, .attr = cpufreq_generic_attr, };