From patchwork Tue Aug 13 13:32:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19066 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C77D246B8 for ; Tue, 13 Aug 2013 13:34:32 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id k18sf4335078oag.6 for ; Tue, 13 Aug 2013 06:34:31 -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=swFN9sNx/n/WzSPfF6Yb/JuN++10jpra2Fqrf+cy8KE=; b=TkY/2Cn3lR4dN7f5V9/yUA56wIkadNh52Sc+pAWGE64nMM1jsdl+/Vvf8pCjmw0EWf Uqjnmiz4jksfs14Xexf22mB0nD3uYEBZ5M1EOzKc8jbuMkEjUQp7GKnawB15hvTKOAz4 j+LHu4PnAkNwkVkWueNONPxlki29KLbsjx6UH1NNihmafJ1TrROrrmHMv3tutMUkLikk uO4EjWw5jKKDYP8iiubS2SeSafQeSwSxGbb4RxQ/rV+rsx5bM182PGKDHBN4dJ/J2oop B7QjM2OfVkWHMDVlxmtCPqg+AIY7N2X2hHO0mR4fJmyLzrsFlWhKAAu1PLNyMPrfgJL7 prRQ== X-Received: by 10.43.55.209 with SMTP id vz17mr2587748icb.0.1376400871759; Tue, 13 Aug 2013 06:34:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.61.135 with SMTP id p7ls37526qer.54.gmail; Tue, 13 Aug 2013 06:34:31 -0700 (PDT) X-Received: by 10.52.244.78 with SMTP id xe14mr3774560vdc.30.1376400871497; Tue, 13 Aug 2013 06:34:31 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id gq10si9738742vdc.134.2013.08.13.06.34.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id c13so6678319vea.38 for ; Tue, 13 Aug 2013 06:34:31 -0700 (PDT) X-Gm-Message-State: ALoCoQkOzTAzUAMGl6a2aTJgBsgRUYYUWmcX2CreHvwfU8hTYpdJlFhhPb6wv7P2LP7hAaZz9Maq X-Received: by 10.221.47.193 with SMTP id ut1mr4465051vcb.8.1376400871414; Tue, 13 Aug 2013 06:34:31 -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 u4csp154179vcz; Tue, 13 Aug 2013 06:34:30 -0700 (PDT) X-Received: by 10.66.171.204 with SMTP id aw12mr3912128pac.7.1376400870599; Tue, 13 Aug 2013 06:34:30 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id bk3si25141192pbd.58.2013.08.13.06.34.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id v10so4931091pde.10 for ; Tue, 13 Aug 2013 06:34:30 -0700 (PDT) X-Received: by 10.68.230.106 with SMTP id sx10mr3062160pbc.170.1376400870089; Tue, 13 Aug 2013 06:34:30 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id mt5sm16549366pbb.35.2013.08.13.06.34.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:29 -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 V2 11/35] cpufreq: e_powersaver: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:24 +0530 Message-Id: <3c28e02820bf453e6584eeb9e7cdd46cbb200c7c.1376392602.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.128.179 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 a8cbbd0..60cd576 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 = eps_target, + .target_index = eps_target, .init = eps_cpu_init, .exit = eps_cpu_exit, .get = eps_get,