From patchwork Mon Aug 12 17:48:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19030 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1B18246B8 for ; Mon, 12 Aug 2013 17:51:55 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf8315516yhz.11 for ; Mon, 12 Aug 2013 10:51:55 -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=3EKVKmFXr0XFhxg0bd9DBL2L3KuyG6tufZh2gP4ZI9M=; b=dgnrsh88Fo2staucRtwqfdAeg0eyhpkYdadszim9EIjHUty1GIRRZGKoU+FgK76wbH 9TH91JMbOSKDMy91k4c3d/OOXwFV9WSXUxO91CI+V3e4mie7dDl9qN5J7oeqIklTWfqh 1gtlP6uCp5Y76xYuUrkEl741w0X1ex4K/OJldbgvU0W8BsM7GNs9EbbKPFrmjnn2e78p +ozIe5CpvVB6YQF1QM4eeOY3CusEiYAwHEnkPI3tytQOuPa3BvcOigUHHRhtWyIrhvNx yC5GacMD8thXzoxoIwH03pqeoP13SmSoXZDmrWEZvaaxZgriKhRq3H3hQaFCNtQF3WKY 4G/w== X-Received: by 10.236.151.44 with SMTP id a32mr61323yhk.51.1376329915627; Mon, 12 Aug 2013 10:51:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.104 with SMTP id lj8ls2534185qeb.11.gmail; Mon, 12 Aug 2013 10:51:55 -0700 (PDT) X-Received: by 10.221.3.200 with SMTP id nz8mr142818vcb.67.1376329915432; Mon, 12 Aug 2013 10:51:55 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id qc1si8591837vec.46.2013.08.12.10.51.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 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.41; Received: by mail-vb0-f41.google.com with SMTP id g17so5933427vbg.14 for ; Mon, 12 Aug 2013 10:51:55 -0700 (PDT) X-Gm-Message-State: ALoCoQlo/0NzxeQIRoGi446wX7Y/z/J+pfUyklB4niHmPhxhXG9iq6/4Or/6JBITk/F54K8z9EMG X-Received: by 10.220.183.2 with SMTP id ce2mr146891vcb.58.1376329915357; Mon, 12 Aug 2013 10:51:55 -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 u4csp108272vcz; Mon, 12 Aug 2013 10:51:54 -0700 (PDT) X-Received: by 10.68.169.97 with SMTP id ad1mr240730pbc.84.1376329914403; Mon, 12 Aug 2013 10:51:54 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id ua7si23307451pac.175.2013.08.12.10.51.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id p10so3728958pdj.4 for ; Mon, 12 Aug 2013 10:51:54 -0700 (PDT) X-Received: by 10.68.189.228 with SMTP id gl4mr253394pbc.57.1376329914013; Mon, 12 Aug 2013 10:51:54 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id w8sm41395359paj.4.2013.08.12.10.51.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:53 -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 , "David S. Miller" Subject: [PATCH 20/31] cpufreq: p4: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:56 +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.41 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: 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 e34857a..f4a193d 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); @@ -256,7 +246,7 @@ static unsigned int cpufreq_p4_get(unsigned int cpu) static struct cpufreq_driver p4clockmod_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target_old = cpufreq_p4_target, + .target = cpufreq_p4_target, .init = cpufreq_p4_cpu_init, .exit = cpufreq_generic_exit, .get = cpufreq_p4_get,