From patchwork Mon Aug 12 17:48:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19021 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 908D4246B8 for ; Mon, 12 Aug 2013 17:50:52 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf11sf4888370vcb.2 for ; Mon, 12 Aug 2013 10:50:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; 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=Z+L11xLKkgdrcmJ7uJE9t06zd1WXFA/6yG6C9rnG+vY=; b=mgHu3oue2SJ+6jt8+nngpprUkO387ggAxnCGDNtSBsZfqYx9fFbxsMFkq6hEkF5YEt BRbTH4Rrg/Arh/LslkCMpbt5grJHAq3voT04V+yLEmaZFzkiVFQs/9KaMweOtD8LJScW dVinzpKettmoF/umJaCwT5R/VCRigZbUVHiLEyTdN96d+g+V2W8EzmZiAtJNAvEkCZRz /PeXNKQtpie3uAxnIcDuMbZiD7ZPYFsmOG+9Sj6xmL1R2WkK4yihxk0dNtXWA0+KxEpo hOvQd5sR7IUFXcOkR11ZW1NJ3nYH7XOrRK8zOeZu0yD3XLiw8qU+54995k7mRb2nmtur lAzw== X-Received: by 10.236.151.44 with SMTP id a32mr60178yhk.51.1376329852338; Mon, 12 Aug 2013 10:50:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.136 with SMTP id km8ls1741813qeb.32.gmail; Mon, 12 Aug 2013 10:50:52 -0700 (PDT) X-Received: by 10.58.155.6 with SMTP id vs6mr150101veb.32.1376329852185; Mon, 12 Aug 2013 10:50:52 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id s17si8592676vcu.14.2013.08.12.10.50.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 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.45; Received: by mail-vb0-f45.google.com with SMTP id e15so5933685vbg.18 for ; Mon, 12 Aug 2013 10:50:52 -0700 (PDT) X-Gm-Message-State: ALoCoQkNERR1nsirg52pozJptgCr1JCPJ+HoT9KVsuhp1TxuS5qKNnJAo7Kt7HZL9rCFKObEUVYe X-Received: by 10.221.51.206 with SMTP id vj14mr153901vcb.17.1376329852098; Mon, 12 Aug 2013 10:50:52 -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 u4csp108204vcz; Mon, 12 Aug 2013 10:50:51 -0700 (PDT) X-Received: by 10.68.90.99 with SMTP id bv3mr236689pbb.108.1376329851169; Mon, 12 Aug 2013 10:50:51 -0700 (PDT) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id xq4si23294692pab.231.2013.08.12.10.50.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id rr4so6046108pbb.34 for ; Mon, 12 Aug 2013 10:50:50 -0700 (PDT) X-Received: by 10.66.147.9 with SMTP id tg9mr259980pab.5.1376329850774; Mon, 12 Aug 2013 10:50:50 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id oj6sm41379439pab.9.2013.08.12.10.50.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:50 -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 11/31] cpufreq: elanfreq: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:47 +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.212.45 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_old() to newly defined light weight .target() 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 cf73815..58f5669 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 */ @@ -238,7 +210,7 @@ __setup("elanfreq=", elanfreq_setup); static struct cpufreq_driver elanfreq_driver = { .get = elanfreq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target_old = elanfreq_target, + .target = elanfreq_target, .init = elanfreq_cpu_init, .exit = cpufreq_generic_exit, .name = "elanfreq",