From patchwork Mon Aug 12 17:48:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19020 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0555C246B8 for ; Mon, 12 Aug 2013 17:50:46 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf8318239yhq.1 for ; Mon, 12 Aug 2013 10:50:45 -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=3kFqtrPbBjJN19mbl2y5CLi9TYOjQJi7e9ed/AELt20=; b=Ovy8OaP+i//OGC/KLLLl1n9O0XZLYbaFPsbf4SNxCvUqJ6C1UzdTIXQBXf3Q5V7Sco dRyTWsTd6d7qYjEPG3fpk0Y4AEG7DpOY+k7s/klp4PfkqpAN3Ij+0+d/tTusuWALNQPi BbYNl9h0sBp6rr+CPsJvHcggJ0pd8GOlCOnXRLJ5jjCPzmB50DEF1cG6DQEdNnixVc/t ZPcYiMDSa/965+Wc80jAI+iRX0PclQHlANQAaasU7t4WYFn/XvmPI1ON4DXgxufAvirh e6Hu41FbZw4c3ACqGjzW9tB78JJNEnZhoPVSXBumxifbRDIrKySD6Vtw3MNzZXXwaX4p GyXg== X-Received: by 10.236.51.225 with SMTP id b61mr75174yhc.4.1376329845610; Mon, 12 Aug 2013 10:50:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.68 with SMTP id dq4ls2363750qeb.5.gmail; Mon, 12 Aug 2013 10:50:45 -0700 (PDT) X-Received: by 10.52.120.114 with SMTP id lb18mr128355vdb.23.1376329845469; Mon, 12 Aug 2013 10:50:45 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id q1si8583122vex.119.2013.08.12.10.50.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 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.44; Received: by mail-vb0-f44.google.com with SMTP id e13so5959992vbg.31 for ; Mon, 12 Aug 2013 10:50:45 -0700 (PDT) X-Gm-Message-State: ALoCoQk9aHwtF/s9rs0TzY2OcMDdID6lEYzMR2sPNJv6RTM7GPmmzZWuXaEYIvUsWS8liSAvs8hn X-Received: by 10.52.73.135 with SMTP id l7mr133811vdv.9.1376329845214; Mon, 12 Aug 2013 10:50:45 -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 u4csp108192vcz; Mon, 12 Aug 2013 10:50:44 -0700 (PDT) X-Received: by 10.68.225.195 with SMTP id rm3mr248207pbc.70.1376329844359; Mon, 12 Aug 2013 10:50:44 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id yo4si6258187pac.150.2013.08.12.10.50.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so7816416pad.32 for ; Mon, 12 Aug 2013 10:50:44 -0700 (PDT) X-Received: by 10.68.111.197 with SMTP id ik5mr220992pbb.171.1376329843962; Mon, 12 Aug 2013 10:50:43 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xe9sm38601001pbc.21.2013.08.12.10.50.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:43 -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 Subject: [PATCH 10/31] cpufreq: e_powersaver: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:46 +0530 Message-Id: <6ed364b4a3b721d44ab6938d7a892dfa3b10e712.1376329128.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.44 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/e_powersaver.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index 00f963a..503496d 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -168,12 +168,9 @@ postchange: return err; } -static int eps_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int eps_target(struct cpufreq_policy *policy, unsigned int index) { struct eps_cpu_data *centaur; - unsigned int newstate = 0; unsigned int cpu = policy->cpu; unsigned int dest_state; int ret; @@ -182,16 +179,8 @@ static int eps_target(struct cpufreq_policy *policy, return -ENODEV; centaur = eps_cpu[cpu]; - if (unlikely(cpufreq_frequency_table_target(policy, - &eps_cpu[cpu]->freq_table[0], - target_freq, - relation, - &newstate))) { - return -EINVAL; - } - /* Make frequency transition */ - dest_state = centaur->freq_table[newstate].driver_data & 0xffff; + dest_state = centaur->freq_table[index].driver_data & 0xffff; ret = eps_set_state(centaur, policy, dest_state); if (ret) printk(KERN_ERR "eps: Timeout!\n"); @@ -419,7 +408,7 @@ static int eps_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver eps_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target_old = eps_target, + .target = eps_target, .init = eps_cpu_init, .exit = eps_cpu_exit, .get = eps_get,