From patchwork Fri Sep 13 13:01:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86D3020358 for ; Fri, 13 Sep 2013 13:21:33 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r3sf1166614yen.7 for ; Fri, 13 Sep 2013 06:21:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=MaIQ+8t9wzt/3RoFcGzXNpNSfx7skZpvxEgzLhzWbFq9kOJ1yR3x2FL/7AHFtl2HAv f3eUpuyWfcsO9NMLotoHbBNc3Z1rMFRRNROi+LTdELwrSIwwL8uCf8qUO5X4Odv/2ofm f56Z7QouZhO6l8yYaF8oFyA53CXprRJoaSolLGbogleogdLJd+1J3hQRqQTMuqPo+RAC 8ve4YXmBx3ykMeZd5KI29FtHM9y//MZQWBIbMEWPrHusYXQ/L97TegT2EVzIuuodjLsh S9RajjYRn8WKr+bxXIp5SrnspywlPtiZHxFrRtTIjkj6jUUiMcw2sJ603oG2JynzuvPT IA7Q== X-Gm-Message-State: ALoCoQnfbA9VU4iyzAbZArSMXh2zcWc+1KtMuTihp3Pl+mWGe2rKan7q1AWWuta/y28ykZTxQ8Kx X-Received: by 10.236.174.232 with SMTP id x68mr5169525yhl.42.1379078493311; Fri, 13 Sep 2013 06:21:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.84 with SMTP id gc20ls1172687qeb.96.gmail; Fri, 13 Sep 2013 06:21:33 -0700 (PDT) X-Received: by 10.58.218.225 with SMTP id pj1mr1683901vec.24.1379078493046; Fri, 13 Sep 2013 06:21:33 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id 10si3128335vcs.30.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e13so918483vbg.3 for ; Fri, 13 Sep 2013 06:21:33 -0700 (PDT) X-Received: by 10.58.161.116 with SMTP id xr20mr11980635veb.2.1379078492968; Fri, 13 Sep 2013 06:21:32 -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 u4csp80402vcz; Fri, 13 Sep 2013 06:21:32 -0700 (PDT) X-Received: by 10.66.27.175 with SMTP id u15mr15059598pag.146.1379078492021; Fri, 13 Sep 2013 06:21:32 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id yk3si11192792pac.215.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id ma3so1223886pbc.35 for ; Fri, 13 Sep 2013 06:21:31 -0700 (PDT) X-Received: by 10.68.196.138 with SMTP id im10mr2471990pbc.127.1379078491631; Fri, 13 Sep 2013 06:21:31 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id a5sm11760187pbw.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:30 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 157/228] cpufreq: elanfreq: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:43 +0530 Message-Id: <47f3f56316c9848750e1dc3328348391b1aa645f.1379063063.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-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.212.44 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",