From patchwork Mon Aug 12 17:48:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19019 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f198.google.com (mail-gh0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1C6D246B8 for ; Mon, 12 Aug 2013 17:50:38 +0000 (UTC) Received: by mail-gh0-f198.google.com with SMTP id r13sf8156720ghr.5 for ; Mon, 12 Aug 2013 10:50:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=T3OkFtIDssG4t+SRBtxBWw+i3cMb7uG5LokZt9bAdLg=; b=iAhvCOt2Nx/Tjxbb7v7mKPwiBA/yoHnRd0w+OUV69Wel6a3S4ZbYyd0E6pP1MS7e0/ 1+bo9X4Kbiv6PpfW9E1AbG+WzmMS4TRS/U9uzMhV+MUkFT9TjWYFE4vuTcXSgldH8Suo McU++RFCp4ug1Rvc/0dkaQR1laMowIhHipWcEXVX5SZ1ywCMn+48aMPy9PT29hGv1+Zj xb0nT8neII7NNGTIH0ZbmMi5+HuzBGXxk+qYqi+axqEz+ioMIQV60kji/BxUuJieaA9J KfiePXAp9zYoWvVG6qteqlyj3N/MN9i6lw7bRGLY9R9//kHVDlmvshG5EVU1LRMQOgYK atiA== X-Received: by 10.236.135.66 with SMTP id t42mr64216yhi.36.1376329838437; Mon, 12 Aug 2013 10:50:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.11 with SMTP id z11ls2521776qem.68.gmail; Mon, 12 Aug 2013 10:50:38 -0700 (PDT) X-Received: by 10.52.186.8 with SMTP id fg8mr122953vdc.53.1376329838321; Mon, 12 Aug 2013 10:50:38 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id y4si8583651vej.113.2013.08.12.10.50.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 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.43; Received: by mail-vb0-f43.google.com with SMTP id h11so5945071vbh.2 for ; Mon, 12 Aug 2013 10:50:38 -0700 (PDT) X-Gm-Message-State: ALoCoQlFDsBLARqvveoxvrpxk4U7kyjMeDDmGVEssG/zw0dKgUpLhvdTwO2x9QYFI3VVYfl2B/DR X-Received: by 10.220.238.81 with SMTP id kr17mr142392vcb.61.1376329838242; Mon, 12 Aug 2013 10:50:38 -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 u4csp108179vcz; Mon, 12 Aug 2013 10:50:37 -0700 (PDT) X-Received: by 10.68.255.69 with SMTP id ao5mr246089pbd.66.1376329837422; Mon, 12 Aug 2013 10:50:37 -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 pn6si22164686pbb.201.2013.08.12.10.50.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:37 -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 jt11so7049643pbb.10 for ; Mon, 12 Aug 2013 10:50:37 -0700 (PDT) X-Received: by 10.66.144.161 with SMTP id sn1mr252631pab.30.1376329837041; Mon, 12 Aug 2013 10:50:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xe9sm38600568pbc.21.2013.08.12.10.50.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:36 -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, Viresh Kumar , Linus Walleij Subject: [PATCH 09/31] cpufreq: dbx500: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:45 +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.212.43 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_old() to newly defined light weight .target() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Linus Walleij Signed-off-by: Viresh Kumar Acked-by: Linus Walleij --- 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 bae4fe9..1943a03 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); @@ -104,7 +94,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_old = dbx500_cpufreq_target, + .target = dbx500_cpufreq_target, .get = dbx500_cpufreq_getspeed, .init = dbx500_cpufreq_init, .name = "DBX500",