From patchwork Fri Aug 16 02:25: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: 19207 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD5222486D for ; Fri, 16 Aug 2013 02:30:10 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 9sf1694039qea.10 for ; Thu, 15 Aug 2013 19:30:10 -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=JRwBRmHDfAu2cq2VzbFcgmitA7AP0PdVxxJY2MJJLJo=; b=hU6GB6kjg0jip87aRuh6egbr+tee/7pKCs0S4MAHwlsjDfbccCEt3dCvmjla8UspuU 04zPYSXWDSxf4i/oDgeyJD8JOI9dEi9gb/YEHtLiY93elqn2qb/laJa891Kw05nq7rbI vgjuIc1apdOoWapIGhc9M9ddlCzPQZQKNesC+ojmj3YOiCi1NT3mgisU/xLhyJj3zNci LG5OJkELJ0ZPcfKDcx3CdKq38xJNCznVAZhrwXpo8cEyalCv3kI+mwfNNEVBfqsiz84K 6Px6HjVHhNP62SvuVVTVyPL3nVKx2zXIhbNeIHLUo6zYUO7t9S+dOX10RLpMOcHpCz5I 2pDA== X-Received: by 10.236.193.6 with SMTP id j6mr345111yhn.44.1376620210648; Thu, 15 Aug 2013 19:30:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.51.40 with SMTP id h8ls636494qeo.28.gmail; Thu, 15 Aug 2013 19:30:10 -0700 (PDT) X-Received: by 10.52.120.7 with SMTP id ky7mr14612595vdb.12.1376620210510; Thu, 15 Aug 2013 19:30:10 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id b1si760363veg.61.2013.08.15.19.30.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so1096386vcb.30 for ; Thu, 15 Aug 2013 19:30:10 -0700 (PDT) X-Gm-Message-State: ALoCoQlv1ULkiButhXjwsaFeHcUupV1XhOIHxG79BfSwDeqjBnC/oLDyy6CjoYJ4fT6UkCydsnqa X-Received: by 10.58.217.167 with SMTP id oz7mr17235384vec.15.1376620210295; Thu, 15 Aug 2013 19:30:10 -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 u4csp45297vcz; Thu, 15 Aug 2013 19:30:09 -0700 (PDT) X-Received: by 10.66.246.106 with SMTP id xv10mr616561pac.100.1376620209365; Thu, 15 Aug 2013 19:30:09 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id mp5si1651832pbc.273.2013.08.15.19.30.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id g10so1596447pdj.2 for ; Thu, 15 Aug 2013 19:30:08 -0700 (PDT) X-Received: by 10.68.212.106 with SMTP id nj10mr18654861pbc.74.1376620208765; Thu, 15 Aug 2013 19:30:08 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ht5sm2702332pbb.29.2013.08.15.19.30.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:08 -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 , Stephen Warren Subject: [PATCH 34/34] cpufreq: tegra: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:31 +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.220.171 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: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 3c2b12b..b376b67 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -102,12 +102,8 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy, unsigned long rate) { int ret = 0; - struct cpufreq_freqs freqs; - freqs.old = tegra_getspeed(0); - freqs.new = rate; - - if (freqs.old == freqs.new) + if (tegra_getspeed(0) == rate) return ret; /* @@ -121,21 +117,10 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy, else clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */ - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - -#ifdef CONFIG_CPU_FREQ_DEBUG - printk(KERN_DEBUG "cpufreq-tegra: transition: %u --> %u\n", - freqs.old, freqs.new); -#endif - - ret = tegra_cpu_clk_set_rate(freqs.new * 1000); - if (ret) { - pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n", - freqs.new); - freqs.new = freqs.old; - } - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + ret = tegra_cpu_clk_set_rate(rate * 1000); + if (ret) + pr_err("cpu-tegra: Failed to set cpu frequency to %lu kHz\n", + rate); return ret; }