From patchwork Fri Sep 13 13:01:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20209 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EEFF20358 for ; Fri, 13 Sep 2013 13:21:20 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id c14sf1235662vea.5 for ; Fri, 13 Sep 2013 06:21:19 -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=04qd0VCAWIpmAiQ3kvqBn+P3jDP6YvjThieWaIUPzS4=; b=mkPBldF+2voMdFNxpeeU/L66nk4wYsnDgoGDChEPGIleCitcsFN2jyWJnuc30NNsxO 13L1+cqA6mqAO4mJ/ieX0aoqopa8Vj6mtnFPoOD+YcZUh1nQuJ1H8rZAPVvnZLyTR29q /wXUfZ3Ql6Kc3i72UFp6HAGm4x0uMzJwayORZKOmFOOVlIam0i8Vo3SEeesgjzW6TVdh DXluJQ72N9q3F+T48Zb943nrTFP3JK0p9fgtHemm0qNdriG/ocYk7KPzk10F8gH7bysd nVXrV7oSp9+v2MNKFrykIrKwNpWtbwni56rpSzgeMX+JXrQ51dm51w3OawU9O8yXeddZ gdyQ== X-Gm-Message-State: ALoCoQlXldf7W/CpAC5NBW9V4A/FA+/BjdFh9f6BJ3nXsYbFH+SFistBYlI7XUzHe1W6vAOEYnwB X-Received: by 10.236.145.34 with SMTP id o22mr5179658yhj.22.1379078479703; Fri, 13 Sep 2013 06:21:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.172 with SMTP id v12ls1187530qef.91.gmail; Fri, 13 Sep 2013 06:21:19 -0700 (PDT) X-Received: by 10.220.169.203 with SMTP id a11mr1683492vcz.26.1379078479411; Fri, 13 Sep 2013 06:21:19 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id z6si3099745vcu.145.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so934882veb.41 for ; Fri, 13 Sep 2013 06:21:19 -0700 (PDT) X-Received: by 10.58.196.132 with SMTP id im4mr1085649vec.28.1379078479325; Fri, 13 Sep 2013 06:21:19 -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 u4csp80394vcz; Fri, 13 Sep 2013 06:21:18 -0700 (PDT) X-Received: by 10.66.240.67 with SMTP id vy3mr15021924pac.141.1379078478400; Fri, 13 Sep 2013 06:21:18 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id br4si7437034pbd.243.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Received: by mail-pb0-f51.google.com with SMTP id jt11so1223657pbb.24 for ; Fri, 13 Sep 2013 06:21:18 -0700 (PDT) X-Received: by 10.68.25.170 with SMTP id d10mr13640821pbg.78.1379078477971; Fri, 13 Sep 2013 06:21:17 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id om2sm11728196pbc.30.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:17 -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 Subject: [PATCH 155/228] cpufreq: dbx500: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:41 +0530 Message-Id: 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.182 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. Acked-by: Linus Walleij Signed-off-by: Viresh Kumar --- drivers/cpufreq/dbx500-cpufreq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index a60f769..238b169 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -20,23 +20,13 @@ static struct cpufreq_frequency_table *freq_table; static struct clk *armss_clk; static int dbx500_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - unsigned int idx; int ret; - /* Lookup the next frequency */ - if (cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx)) - return -EINVAL; - freqs.old = policy->cur; - freqs.new = freq_table[idx].frequency; - - if (freqs.old == freqs.new) - return 0; + freqs.new = freq_table[index].frequency; /* pre-change notification */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); @@ -80,7 +70,7 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver dbx500_cpufreq_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, .verify = cpufreq_generic_frequency_table_verify, - .target = dbx500_cpufreq_target, + .target_index = dbx500_cpufreq_target, .get = dbx500_cpufreq_getspeed, .init = dbx500_cpufreq_init, .name = "DBX500",