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: 2843775 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4DB59BF546 for ; Tue, 13 Aug 2013 15:43:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19951204FB for ; Tue, 13 Aug 2013 15:43:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C404E204F1 for ; Tue, 13 Aug 2013 15:43:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Em3-0007cz-C8; Tue, 13 Aug 2013 13:36:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9ElO-0007zi-0N; Tue, 13 Aug 2013 13:35:54 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EkN-0007lW-5B for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:34:53 +0000 Received: by mail-pd0-f175.google.com with SMTP id q10so4888322pdj.6 for ; Tue, 13 Aug 2013 06:34:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=swFN9sNx/n/WzSPfF6Yb/JuN++10jpra2Fqrf+cy8KE=; b=XwdK+Z3WwCPWEsNKe/jXA/a3SA1vPmQj/b7Id+s3CLGJwfvM6dek7K/sbnDkkEfRhK y6FJh67xsbdMqRJ0rzVRufhbifBZynIS841PIXeQCk3KvsgZUw7WijXiossQ5NKmtooe AUEQbuEwbfYjwfP7a3+B+mfPecrrBbpUU7vyfQJrPyEXzBlaURQccbnytpXyHCGzimar yJzvifU3PjOXg66p+jrfsOKMuJ2LTYanQsJPnfo0DmGqzGkCEMl1908YmyadGqftiw0p 2N1BS+eIUnFfmyNq0nsxV77dM98u6u5mCjbj/1KaXwwZv2ZdKlm64iECT4W9MuRO7y3F AfGw== X-Gm-Message-State: ALoCoQkLEBUuolrb+ehMpkdTSmI8aavONJU/ZdSHedwfdUQ7rcsNmOwXR+VS55IdhOEqH5EkKhJL 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130813_093452_144375_9D59A9AB X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,