From patchwork Fri Aug 16 02:25:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6D822486D for ; Fri, 16 Aug 2013 02:29:53 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf1792147vcb.4 for ; Thu, 15 Aug 2013 19:29:53 -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=4W2J3B6wKC9q5fPnbKPjKQ6a9Qp7O+trdMfMEVKxyUA=; b=NBH8Jg9w3X6GehX6aBgAULDTGLfw5VlLvw/lShuCVoTHkbwnjmdKipzUjI/+pr0MF4 qz0E4ue9b5oONsNak1SPcfLwNgS9Jl37IoqxouQFoWbXa4hOJU3uvS7vsECXV81M1ra4 mnnhuwIDyKSGqlssydYKLSqBJ6jXdyEj5HwZQMeK4ARKzEuckBu4IOxreA7OZ0MIvpkz WI+aZ1y5i1xTxUCwa0+DP/ZCpSbTTSUB3i0zv+WAv3pmc3cv4n5GtwzOQsnHP/lvMcIu R8J7KNBsu6VxAVXX64hweZebZ4mwnBMu1pYOYbZqXxZ0967CcBib/xjDaK4Kux30/FP+ GmRw== X-Received: by 10.236.70.5 with SMTP id o5mr413921yhd.12.1376620193583; Thu, 15 Aug 2013 19:29:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.70 with SMTP id f6ls611354qer.59.gmail; Thu, 15 Aug 2013 19:29:53 -0700 (PDT) X-Received: by 10.58.119.233 with SMTP id kx9mr17295465veb.3.1376620193454; Thu, 15 Aug 2013 19:29:53 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id h4si764184vdw.45.2013.08.15.19.29.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so1094200vcb.10 for ; Thu, 15 Aug 2013 19:29:53 -0700 (PDT) X-Gm-Message-State: ALoCoQlygqhmZ9DMjJew8o0ojal4YJ2nvwDLLeDMK6SZzHQpRGELXw58rY4gJY2yW35tSS0qe1YL X-Received: by 10.52.164.102 with SMTP id yp6mr15017664vdb.14.1376620193369; Thu, 15 Aug 2013 19:29:53 -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 u4csp45281vcz; Thu, 15 Aug 2013 19:29:52 -0700 (PDT) X-Received: by 10.66.149.231 with SMTP id ud7mr715378pab.8.1376620192621; Thu, 15 Aug 2013 19:29:52 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id yo4si37399pac.237.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id ma3so1469704pbc.35 for ; Thu, 15 Aug 2013 19:29:52 -0700 (PDT) X-Received: by 10.68.230.106 with SMTP id sx10mr291402pbc.170.1376620192254; Thu, 15 Aug 2013 19:29:52 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id w8sm133281paj.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:51 -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 , spear-devel@list.st.com Subject: [PATCH 32/34] cpufreq: SPEAr: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:29 +0530 Message-Id: <8ce6bd268bfae0bba7b6e5f7fa0914c2d1810cb9.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.220.179 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: spear-devel@list.st.com Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index efacfa1..4ad35a5 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -107,12 +107,10 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq) static int spear_cpufreq_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; unsigned long newfreq; struct clk *srcclk; int ret, mult = 1; - freqs.old = spear_cpufreq_get(0); newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000; if (of_machine_is_compatible("st,spear1340")) { @@ -145,23 +143,14 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy, return newfreq; } - freqs.new = newfreq / 1000; - freqs.new /= mult; - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - if (mult == 2) ret = spear1340_set_cpu_rate(srcclk, newfreq); else ret = clk_set_rate(spear_cpufreq.clk, newfreq); - /* Get current rate after clk_set_rate, in case of failure */ - if (ret) { + if (ret) pr_err("CPU Freq: cpu clk_set_rate failed: %d\n", ret); - freqs.new = clk_get_rate(spear_cpufreq.clk) / 1000; - } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); return ret; }