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: 21142 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B002202FF for ; Fri, 18 Oct 2013 14:01:38 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id v1sf7871511yhn.8 for ; Fri, 18 Oct 2013 07:01:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=IeVqSWKe7/NvdDsmQkhCRdpbAavSvQR2Usv1+kqms9E=; b=CRdh2eDq25qh4ZYgmCH6ThTxjRE6j+JJ+ErKexatj6FohdwX5dim09uRp+DfpjIkys uphrt4/L3rcecflrLd7V2yNKyeQScqvImDQBNI0RpnaqBXhB0hQCnxhkmbV8JjPV3zI6 lnWjMS+LZLitptgyFejnHOw/6+7J/nlHg8QCbvJoB/p5sPrtUwPaqXdTA6TGeKQYlWDt g2yfO5FuqrhusRO9O9z5Zm3j21cgnygO4fj3BYap3uegS/hTqrd/cnHHZKrK16Q4fIEd kFIzZc2HE5hSGuyGkCdWUu/6yOUTtWkIfjRno7q/6vomdPPRi8IctOhbGnr/lk3iqt4W 0qfA== X-Received: by 10.236.101.103 with SMTP id a67mr2525281yhg.25.1382104898130; Fri, 18 Oct 2013 07:01:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.83 with SMTP id s19ls1278568qeu.7.gmail; Fri, 18 Oct 2013 07:01:38 -0700 (PDT) X-Received: by 10.220.92.8 with SMTP id p8mr1533714vcm.20.1382104897956; Fri, 18 Oct 2013 07:01:37 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id st7si337730vdc.16.2013.10.18.07.01.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lc6so448629vcb.1 for ; Fri, 18 Oct 2013 07:01:37 -0700 (PDT) X-Gm-Message-State: ALoCoQlfR/sS8+X6+syhoyxQvYGl/IRO7rBbNBjtlP66SPoZDkE5ueBW96uoNaXLXSB63XTrGxSG X-Received: by 10.52.161.231 with SMTP id xv7mr1859404vdb.1.1382104897864; Fri, 18 Oct 2013 07:01:37 -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 u4csp37968vcz; Fri, 18 Oct 2013 07:01:37 -0700 (PDT) X-Received: by 10.68.50.165 with SMTP id d5mr3262352pbo.162.1382104896872; Fri, 18 Oct 2013 07:01:36 -0700 (PDT) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id a10si1587141pac.76.2013.10.18.07.01.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.48; Received: by mail-pa0-f48.google.com with SMTP id bj1so4574674pad.21 for ; Fri, 18 Oct 2013 07:01:36 -0700 (PDT) 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: 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.220.170 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/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",