From patchwork Fri Sep 13 13:01:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20210 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8F7C20358 for ; Fri, 13 Sep 2013 13:21:26 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id l13sf1202626qcy.9 for ; Fri, 13 Sep 2013 06:21:26 -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=GfZ0rHmW56YZOIAsb6qCP7tmMakN7K9kP+v0szH/0Is=; b=K6wLbsaw4UZYEgUNAc0hQmUQOUFk1xJGhkyHZ1QlBJbl3xZwRy4lfaSBASA8hPUwR5 YGKLHKN/9rSANbUI+zIYG4sk7bnklxGdnzA5WfQllbvQt/INgznGWAwaVlAa5aRSJ8BV UledKzRX8QyR56X3Q9PYb3BNU8iIQTsm/zK8TZDowMy81vECrN2VKC/Ic754KEfI1TyN DwN3bkYdNcQkP09+1yNMDFICkm50nS4bKmIGKNNVBz4MKlzqzLG+rTgnIjw1B55OiDNp 3ZjLe5V1TGer3URFjxik04RI+cx4t7bHeQb81JoPRx3wZMJUhQSw7N3oww6DDENAb8e1 ImnQ== X-Gm-Message-State: ALoCoQlpXNFD3cxbGs9i4RaEL+5OH1CoyMF1GgPGkol+VhJ3GCuMEsZ4fr22ACXIBgP62W1zYmv5 X-Received: by 10.236.207.103 with SMTP id m67mr5022671yho.1.1379078486512; Fri, 13 Sep 2013 06:21:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls1206633qed.61.gmail; Fri, 13 Sep 2013 06:21:26 -0700 (PDT) X-Received: by 10.220.10.194 with SMTP id q2mr11853018vcq.2.1379078486254; Fri, 13 Sep 2013 06:21:26 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id zw10si3096095vdb.135.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 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.50; Received: by mail-vb0-f50.google.com with SMTP id x14so884238vbb.37 for ; Fri, 13 Sep 2013 06:21:26 -0700 (PDT) X-Received: by 10.52.37.69 with SMTP id w5mr1329873vdj.32.1379078486158; Fri, 13 Sep 2013 06:21:26 -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 u4csp80398vcz; Fri, 13 Sep 2013 06:21:25 -0700 (PDT) X-Received: by 10.67.30.164 with SMTP id kf4mr15320406pad.13.1379078485171; Fri, 13 Sep 2013 06:21:25 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id se2si7482328pbc.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w10so1244241pde.37 for ; Fri, 13 Sep 2013 06:21:24 -0700 (PDT) X-Received: by 10.66.163.164 with SMTP id yj4mr15489764pab.91.1379078484770; Fri, 13 Sep 2013 06:21:24 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id nj9sm11750203pbc.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:24 -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 156/228] cpufreq: e_powersaver: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:42 +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.50 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,