From patchwork Mon Aug 12 17:49:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19037 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 90D41246B8 for ; Mon, 12 Aug 2013 17:52:44 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf3073942qab.5 for ; Mon, 12 Aug 2013 10:52:44 -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=yfYmti3GVckAlCCXgw6e8XmT+oRT3sehaDjgDUEhbmc=; b=oycVBdH4mlLvvsBxnwQxqCr9pa7CykTs1cvXZNUGPr4amHbPQWO5BOQNg6TrUw5YTh zfs5A1/VVenin2wGBOUAfY0zZ96ZOlmg6Js0F6bTnHZnzUsmKx8wWBotTiqWYq9d1QCg M8vDrDHMw6NCsXunt92C16te9HXa9BkBozs99LiVCQCfTTQ6lvv95ljNWQQgMFQ4uJ/m nNNXt9S1Ka/7fS4RUZTgkHW0VpwaZwErPG64JDpyMGNb5u3qwOQVebHnrJH3b8ChJskh QRWmM/LKXv8knjQnTi+7sZ3Vlos4aZZL/aH4J7obGvSanjCOBn1ZccVbHI/nTw5n4eZ3 COwQ== X-Received: by 10.236.112.33 with SMTP id x21mr58791yhg.57.1376329964405; Mon, 12 Aug 2013 10:52:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.49 with SMTP id r17ls2202979qeu.51.gmail; Mon, 12 Aug 2013 10:52:44 -0700 (PDT) X-Received: by 10.220.88.13 with SMTP id y13mr158544vcl.20.1376329964265; Mon, 12 Aug 2013 10:52:44 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id jf10si8584240vdb.115.2013.08.12.10.52.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id d10so5886708vea.19 for ; Mon, 12 Aug 2013 10:52:44 -0700 (PDT) X-Gm-Message-State: ALoCoQlbSPfouotKj/NYsgjCNwn33C7RdwZDy1u0+Lk2h5OPq1cGr/NaP/r+biGb4e3TbQjbPVHU X-Received: by 10.58.211.7 with SMTP id my7mr149089vec.54.1376329964168; Mon, 12 Aug 2013 10:52:44 -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 u4csp108318vcz; Mon, 12 Aug 2013 10:52:43 -0700 (PDT) X-Received: by 10.66.121.131 with SMTP id lk3mr252575pab.43.1376329963244; Mon, 12 Aug 2013 10:52:43 -0700 (PDT) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by mx.google.com with ESMTPS id hs9si22158927pbc.244.2013.08.12.10.52.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.177 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.177; Received: by mail-pd0-f177.google.com with SMTP id y10so3714283pdj.36 for ; Mon, 12 Aug 2013 10:52:42 -0700 (PDT) X-Received: by 10.68.106.36 with SMTP id gr4mr267595pbb.0.1376329962869; Mon, 12 Aug 2013 10:52:42 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id bb1sm38627225pbc.10.2013.08.12.10.52.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:42 -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 27/31] cpufreq: sc520: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:19:03 +0530 Message-Id: <6b0045abb84cb32ef29731c18bd6416bf984ee5c.1376329128.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.128.174 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/sc520_freq.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index 022da40..617dd5a 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -53,8 +53,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu) } } -static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int state) { struct cpufreq_freqs freqs; @@ -76,24 +75,10 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int sc520_freq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, sc520_freq_table, - target_freq, relation, &newstate)) - return -EINVAL; - - sc520_freq_set_cpu_state(policy, newstate); return 0; } - /* * Module init and exit code */ @@ -118,7 +103,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target_old = sc520_freq_target, + .target = sc520_freq_target, .init = sc520_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "sc520_freq",