From patchwork Tue Aug 13 13:32:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843779 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 A2A9DBF546 for ; Tue, 13 Aug 2013 15:52:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D79B20514 for ; Tue, 13 Aug 2013 15:52:51 +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 60CAE204FB for ; Tue, 13 Aug 2013 15:52:50 +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 1V9Eln-0007Pl-FR; Tue, 13 Aug 2013 13:36:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9ElB-0007xo-82; Tue, 13 Aug 2013 13:35:41 +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 1V9EkG-0007kI-Ez for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:34:45 +0000 Received: by mail-pb0-f47.google.com with SMTP id rr4so7974790pbb.6 for ; Tue, 13 Aug 2013 06:34:22 -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=l9awPe7raFVp9LK6vTKvKMqnDRur6Mja4B4lae+xwFo=; b=NrDE4M9yyCzxNLN8SeK08dwvYu4rK6kTOYheJuNNCX9yV+tFypG7xZgJis2iWtugqH h0iVNRWTcCaYfEBfKh3XsvzMib/Xos6c7PTQ/S9XAAR93YmMM4DjjhxCUPKoW1unYQWj NLV9WC5ojmcn+FOrBx/CV+tsLlJckHAnvT/w36VwZi3HQG+QfC249zrSvbSL82H683pz BncE5ZoI6h3zmXj6BspFD9t/15nFM1xaJWASwstx31sOk76YXVhZsLjjfZ3mPCU1QQkK 6k4bIqzFe9WpTPNdNw4nFdgPtPE/jihJ+d5Bt7QvygQFPiAbq34hmvn/t3xo/VJFuMdd sixQ== X-Gm-Message-State: ALoCoQmtP4txcvmInJdK5f56fMvoXp74G0kiq3H7AuqnqhQSDYPQbe5/H7R6d8V/9IDxTwyrdmGa X-Received: by 10.67.11.103 with SMTP id eh7mr4655397pad.153.1376400862636; Tue, 13 Aug 2013 06:34:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id z14sm44024382pbt.0.2013.08.13.06.34.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:21 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 10/35] cpufreq: dbx500: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:23 +0530 Message-Id: <79809d6e1f6f78cec69aa44103c09a81839301e8.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_093444_630926_25043F93 X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , Linus Walleij , 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. Cc: Linus Walleij Signed-off-by: Viresh Kumar --- drivers/cpufreq/dbx500-cpufreq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 7e2f9c0..28deaf0 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -20,23 +20,13 @@ static struct cpufreq_frequency_table *freq_table; static struct clk *armss_clk; static int dbx500_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - unsigned int idx; int ret; - /* Lookup the next frequency */ - if (cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx)) - return -EINVAL; - freqs.old = policy->cur; - freqs.new = freq_table[idx].frequency; - - if (freqs.old == freqs.new) - return 0; + freqs.new = freq_table[index].frequency; /* pre-change notification */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); @@ -104,7 +94,7 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver dbx500_cpufreq_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, .verify = cpufreq_generic_frequency_table_verify, - .target = dbx500_cpufreq_target, + .target_index = dbx500_cpufreq_target, .get = dbx500_cpufreq_getspeed, .init = dbx500_cpufreq_init, .name = "DBX500",