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: 2887711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B0E919F1E3 for ; Fri, 13 Sep 2013 13:36:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15077201CE for ; Fri, 13 Sep 2013 13:36:52 +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 4AC32202EA for ; Fri, 13 Sep 2013 13:36:47 +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 1VKTWH-00005I-F6; Fri, 13 Sep 2013 13:34:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKTVJ-00019c-0c; Fri, 13 Sep 2013 13:33:45 +0000 Received: from mail-pb0-f47.google.com ([209.85.160.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKTJi-0007tA-0a for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2013 13:21:46 +0000 Received: by mail-pb0-f47.google.com with SMTP id rr4so1227842pbb.6 for ; Fri, 13 Sep 2013 06:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=GfZ0rHmW56YZOIAsb6qCP7tmMakN7K9kP+v0szH/0Is=; b=PwKxGkQI1ysgb5S19ymX7SMr0ffsgMWUTEge3xeIN73j2u4YcA1k9Bjfq7OmkRxfNW Ze5L557q+6GigH16B9Hxx4XUUzlHaZAj5Z9FZ2XQgWOgCRszcmVTw6cZCrO573t9AvtG uDtJeDljC5IO1X0AJ6URRKikDX6cizuiHJyGluxsftY7GLOuS+xA6WV2fU2cJ1i/rTEn Cef5n4kOgwSGveb+q3Mj8O3NLnoB1NHoj2EKZ5/n6HQDuPT01Dvm0RStkDH0SSYMgluM v5AyF3alSz/0FDWvu/q8G4DQedEmZ3LfGM772MbnC9yVu/Oxz58UIvtI3FimvOCUUGTP 23KA== X-Gm-Message-State: ALoCoQnFrZH46h3dvxRlE/rUZB1N6RzWwQLzyWWoZKYoIGWhxVSyRJU2PGKCvveQ0BGSqeVJwpKh 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130913_092146_158570_CC094917 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -2.6 (--) 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=-5.1 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 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,