From patchwork Fri Oct 18 13:59:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 3067641 Return-Path: X-Original-To: patchwork-linux-pm@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 BBC05BF924 for ; Fri, 18 Oct 2013 14:08:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C3542039A for ; Fri, 18 Oct 2013 14:08:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 005F52013D for ; Fri, 18 Oct 2013 14:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755371Ab3JROBk (ORCPT ); Fri, 18 Oct 2013 10:01:40 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:63518 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755397Ab3JROBg (ORCPT ); Fri, 18 Oct 2013 10:01:36 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so4596852pab.12 for ; Fri, 18 Oct 2013 07:01:36 -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=IeVqSWKe7/NvdDsmQkhCRdpbAavSvQR2Usv1+kqms9E=; b=PjtM3nsRrwdMUQYT9kj6GbqfUPrXDq0ODBN6M67QYGtJ7Vvh9VD5gUiPRriRDlfxr+ 2m5N9iAJ8xJwhSK5eQTe6ll4tx1KWThcoIq+oGHilqfVzP7fO5iITFgCkXTxPFzsuCa+ RlHxMfBs8VWV/Tu1iO4w5cZigwB81WUxVKjexK9oy4a8yUdbCq73HtcibdGeWoTEH6Ap 32wt9zu5+6+Qy4pCHJ9QFNpPP8m+jwnKvLcDKXY25m6P23vbJh/hJIuGiBn7SOoTRXmt FfGdgVfWmbw6SJAqaE9Okofggejwp0r38md0fQCGNmrFSvXRFZnDOyBCVR7HdlwO8Amv VA+g== X-Gm-Message-State: ALoCoQmqaX4zwmqaEbEf53C8sZCk6891QD8U6iN7pCZ8HOJBb85edYbll+Almo8nh2aXfFIzFa+p X-Received: by 10.66.231.42 with SMTP id td10mr3627285pac.144.1382104896456; Fri, 18 Oct 2013 07:01:36 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id er3sm2588034pbb.40.2013.10.18.07.01.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:35 -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, Viresh Kumar Subject: [PATCH V2 Resend 11/34] cpufreq: elanfreq: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:34 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, 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/elanfreq.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c index d91a645..4ab4153 100644 --- a/drivers/cpufreq/elanfreq.c +++ b/drivers/cpufreq/elanfreq.c @@ -105,20 +105,8 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu) } -/** - * elanfreq_set_cpu_frequency: Change the CPU core frequency - * @cpu: cpu number - * @freq: frequency in kHz - * - * This function takes a frequency value and changes the CPU frequency - * according to this. Note that the frequency has to be checked by - * elanfreq_validatespeed() for correctness! - * - * There is no return value. - */ - -static void elanfreq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int elanfreq_target(struct cpufreq_policy *policy, + unsigned int state) { struct cpufreq_freqs freqs; @@ -162,25 +150,9 @@ static void elanfreq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - - -static int elanfreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, &elanfreq_table[0], - target_freq, relation, &newstate)) - return -EINVAL; - - elanfreq_set_cpu_state(policy, newstate); return 0; } - - /* * Module init and exit code */ @@ -237,7 +209,7 @@ __setup("elanfreq=", elanfreq_setup); static struct cpufreq_driver elanfreq_driver = { .get = elanfreq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = elanfreq_target, + .target_index = elanfreq_target, .init = elanfreq_cpu_init, .exit = cpufreq_generic_exit, .name = "elanfreq",