From patchwork Fri Oct 18 13:59:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21141 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4F81202FF for ; Fri, 18 Oct 2013 14:01:30 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id w8sf1843861qac.10 for ; Fri, 18 Oct 2013 07:01:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=GfZ0rHmW56YZOIAsb6qCP7tmMakN7K9kP+v0szH/0Is=; b=UT9pcBWN+hx1961xXh/+llYGGCx+sgaCTGQARL8Fdrm6U5iWTCB/fpx+IgRaefcUqL r/1+Mnc06+CkrTPaPLTMWIQzWKvCVdbtu/JPCG0k8iFcySvW9m5GBcsq0HIniGUuVGn4 K9/oBFrZWs40zDpheljNOqPMO7wEugDoy5x7p0DKwdHHQlBNRaLzHC4lFt7UluN56caA GZmSDUHvvgrujeMUHl0j7uyfoNKS4+yXuoZMDLVkvESwKwkgUniY/briBReV2OuI9d1l N21iM28Vbyqv38BdSoWUSF4QDQ6PqKKGaRXPT3R6tA50weKYCXYuXHt4OMcfHDWalfk3 Iy/A== X-Received: by 10.236.135.211 with SMTP id u59mr2625696yhi.43.1382104890454; Fri, 18 Oct 2013 07:01:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.100 with SMTP id j4ls1360121qew.29.gmail; Fri, 18 Oct 2013 07:01:30 -0700 (PDT) X-Received: by 10.52.118.98 with SMTP id kl2mr234877vdb.30.1382104890341; Fri, 18 Oct 2013 07:01:30 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id bl10si339309vcb.9.2013.10.18.07.01.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 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.52; Received: by mail-vb0-f52.google.com with SMTP id f12so1929140vbg.11 for ; Fri, 18 Oct 2013 07:01:30 -0700 (PDT) X-Gm-Message-State: ALoCoQmBTcN2jzHprDoluwrV7cVZhPbVXPAom4pthThJR9pnHj84uODdYMNWNSPVSK6Q6CQ+6+Ub X-Received: by 10.58.161.231 with SMTP id xv7mr2189873veb.2.1382104890253; Fri, 18 Oct 2013 07:01:30 -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 u4csp37958vcz; Fri, 18 Oct 2013 07:01:29 -0700 (PDT) X-Received: by 10.68.170.225 with SMTP id ap1mr3182449pbc.117.1382104889368; Fri, 18 Oct 2013 07:01:29 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id gn4si995920pbc.141.2013.10.18.07.01.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id hz1so3650708pad.2 for ; Fri, 18 Oct 2013 07:01:29 -0700 (PDT) X-Received: by 10.68.189.40 with SMTP id gf8mr3210183pbc.150.1382104888957; Fri, 18 Oct 2013 07:01:28 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id b3sm2592025pbu.38.2013.10.18.07.01.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:28 -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 V2 Resend 10/34] cpufreq: e_powersaver: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:33 +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.52 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. 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 2c11ce3..b39c4ef 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"); @@ -418,7 +407,7 @@ static int eps_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver eps_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = eps_target, + .target_index = eps_target, .init = eps_cpu_init, .exit = eps_cpu_exit, .get = eps_get,