From patchwork Fri Aug 16 02:25:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19201 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 D05FA2486D for ; Fri, 16 Aug 2013 02:29:21 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf234712yho.8 for ; Thu, 15 Aug 2013 19:29:21 -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=Y7cEXuHGoF50q4ZvJfiu02HoyzoGaQ4rvmE+xiNNVt8=; b=I4SugXpOUhloDQxjgIS06qQjblAPCY5lrLC/8XF3Cn5VdUjECQEBxFG68UWquK3YwT 2+HVIQq6qac15/EHL74PuMYQebNBwlH3YAd9rfaKji4xTTY+/VTgV6KkeXcSXalv1AcR 9AJNUFJlijAcDPytX6hjqVVDpDD6iAkjAU5f325wWArqb0MZq/fYGwgCfjaDjI29Sx3R Hg7ZAE5NyQ+8blQFHGY7ZqIPIytx5lJtllxcb/7SW6wjlO1DnQPwe3fy9KqkPeHCQ7eW QT2QZ4QwOVkJK4jhELfmKfLHoWpXgGSkem6bbM23HJZTbEBXMuY2OVu/dx/BDVAoJJ90 6sJQ== X-Received: by 10.236.4.69 with SMTP id 45mr360769yhi.20.1376620161556; Thu, 15 Aug 2013 19:29:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.177 with SMTP id gf17ls570932qeb.4.gmail; Thu, 15 Aug 2013 19:29:21 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr17568928vem.9.1376620161433; Thu, 15 Aug 2013 19:29:21 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id h4si649535vdw.136.2013.08.15.19.29.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 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.42; Received: by mail-vb0-f42.google.com with SMTP id e12so1231622vbg.15 for ; Thu, 15 Aug 2013 19:29:21 -0700 (PDT) X-Gm-Message-State: ALoCoQkRZHWAfwNJSd5Z0AnyZoPvw44eXA+gkydIu+Xo7LALp56MFD5Tuw7rkAMDp30jrDtPR2h6 X-Received: by 10.52.232.165 with SMTP id tp5mr14594945vdc.11.1376620161310; Thu, 15 Aug 2013 19:29:21 -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 u4csp45262vcz; Thu, 15 Aug 2013 19:29:20 -0700 (PDT) X-Received: by 10.68.19.162 with SMTP id g2mr18635401pbe.140.1376620160414; Thu, 15 Aug 2013 19:29:20 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id yo4si36105pac.237.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so1331986pab.25 for ; Thu, 15 Aug 2013 19:29:20 -0700 (PDT) X-Received: by 10.66.142.107 with SMTP id rv11mr708218pab.17.1376620160032; Thu, 15 Aug 2013 19:29:20 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id nv6sm3102390pbc.6.2013.08.15.19.29.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:19 -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 28/34] cpufreq: s5pv210: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:25 +0530 Message-Id: <18ddada60c1c5b96c6771eb6047a4d5703d3a136.1376619363.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.42 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 76a4177..efa1080 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);