From patchwork Fri Sep 13 13:02:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20259 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29E3020358 for ; Fri, 13 Sep 2013 13:27:27 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id e13sf1207340vbg.8 for ; Fri, 13 Sep 2013 06:27:27 -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=GU1lPGvulCJZK5l8LEFJ3YoAf7hLLxlQnOLV4qxuNig=; b=dj7ictTO6rrCsE9+mr0xHqWHvQNk7KQlX+80rdKmVBjUWay7jD6Ifg3xe7eDBbS1Th yN1RyiQgYOF7FJx0LCTm5b7Gztq1/lORGahhWNrdZyeFAh4uzmcLZ6QNQ1zvZKEHcZF6 NriCNwhGcW9lsofjtkBPW1MC3lCCmUnzJw2khZH8+eKZ8elHmH4fCTnL7rhniS4clPNT EQW4oREPLhnJBtBKYF8adIGSTi164+1bfDZ3HJyJBl8gO4MK+JG0HGgmSZya/CMev3tY Lk4P5z1IMeDRttin4OCUmunE7ayKOzR1hGgnAOy79OnQwdut5my9iFDo8LDmasixBNYv laAA== X-Gm-Message-State: ALoCoQnHCP2NupcMrYiw4BJfxOCfF6NC/HxRbr3mOSH0pgN/LKzx4FMJRekleYAJfC6ae8Pf/ISV X-Received: by 10.236.115.198 with SMTP id e46mr5430424yhh.33.1379078847251; Fri, 13 Sep 2013 06:27:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.62.72 with SMTP id w8ls1160456qer.2.gmail; Fri, 13 Sep 2013 06:27:27 -0700 (PDT) X-Received: by 10.220.46.72 with SMTP id i8mr12207709vcf.10.1379078847032; Fri, 13 Sep 2013 06:27:27 -0700 (PDT) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id de6si3116853vcb.109.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.47 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.47; Received: by mail-vb0-f47.google.com with SMTP id h10so885693vbh.20 for ; Fri, 13 Sep 2013 06:27:27 -0700 (PDT) X-Received: by 10.221.6.195 with SMTP id ol3mr210282vcb.34.1379078846942; Fri, 13 Sep 2013 06:27:26 -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 u4csp80717vcz; Fri, 13 Sep 2013 06:27:26 -0700 (PDT) X-Received: by 10.66.26.112 with SMTP id k16mr15181790pag.65.1379078845967; Fri, 13 Sep 2013 06:27:25 -0700 (PDT) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by mx.google.com with ESMTPS id vs3si11228484pab.172.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.180 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.180; Received: by mail-pd0-f180.google.com with SMTP id y10so1243408pdj.25 for ; Fri, 13 Sep 2013 06:27:25 -0700 (PDT) X-Received: by 10.66.162.136 with SMTP id ya8mr15233027pab.110.1379078845458; Fri, 13 Sep 2013 06:27:25 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id qf7sm18105605pac.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:24 -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 , Kukjin Kim Subject: [PATCH 205/228] cpufreq: s5pv210: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:31 +0530 Message-Id: <3542c13d2492d421cf6b157246fe7e16182ed71f.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.47 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: , Most of the drivers do following in their ->target_index() routines: struct cpufreq_freqs freqs; freqs.old = old freq... freqs.new = new freq... cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); /* Change rate here */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); This is replicated over all cpufreq drivers today and there doesn't exists a good enough reason why this shouldn't be moved to cpufreq core instead. Earlier patches have added support in cpufreq core to do cpufreq notification on frequency change, this one removes it from this driver. Some related minor cleanups are also done along with it. Cc: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/s5pv210-cpufreq.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 5978b94..e3973da 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -26,7 +26,6 @@ static struct clk *cpu_clk; static struct clk *dmc0_clk; static struct clk *dmc1_clk; -static struct cpufreq_freqs freqs; static DEFINE_MUTEX(set_freq_lock); /* APLL M,P,S values for 1G/800Mhz */ @@ -179,6 +178,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) unsigned int priv_index; unsigned int pll_changing = 0; unsigned int bus_speed_changing = 0; + unsigned int old_freq, new_freq; int arm_volt, int_volt; int ret = 0; @@ -193,12 +193,12 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) goto exit; } - freqs.old = s5pv210_getspeed(0); - freqs.new = s5pv210_freq_table[index].frequency; + old_freq = s5pv210_getspeed(0); + new_freq = s5pv210_freq_table[index].frequency; /* Finding current running level index */ if (cpufreq_frequency_table_target(policy, s5pv210_freq_table, - freqs.old, CPUFREQ_RELATION_H, + old_freq, CPUFREQ_RELATION_H, &priv_index)) { ret = -EINVAL; goto exit; @@ -207,7 +207,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) arm_volt = dvs_conf[index].arm_volt; int_volt = dvs_conf[index].int_volt; - if (freqs.new > freqs.old) { + if (new_freq > old_freq) { ret = regulator_set_voltage(arm_regulator, arm_volt, arm_volt_max); if (ret) @@ -219,8 +219,6 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) goto exit; } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - /* Check if there need to change PLL */ if ((index == L0) || (priv_index == L0)) pll_changing = 1; @@ -431,9 +429,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) } } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - if (freqs.new < freqs.old) { + if (new_freq < old_freq) { regulator_set_voltage(int_regulator, int_volt, int_volt_max);