From patchwork Fri Aug 16 02:25:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2845446 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33F3FBF546 for ; Fri, 16 Aug 2013 03:22:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 475B42021B for ; Fri, 16 Aug 2013 03:22:58 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52EDC20219 for ; Fri, 16 Aug 2013 03:22:57 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9mW-0003oa-6W; Fri, 16 Aug 2013 02:28:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9lr-0006i6-BG; Fri, 16 Aug 2013 02:28:11 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9l1-0006WR-B9 for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2013 02:27:21 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz10so1342607pad.16 for ; Thu, 15 Aug 2013 19:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=mmiPEratQDstqd8ktenRIdwmYaLb9fITnxnlJCpO7SE=; b=A0kY/9RW9JhF6XK0o/ibH9dIfAc3Okare2EUjygko+8owcQbTOI8zk6P8OTmWLfC9i I8BOroUaAUqTHcEcodfV+XuyG0EN+F7J8+pSHxb+erRZLN93nB3mOAmLAMSzvjH1VRbt QdN6MCiRzs/e1YMpIX+nAWrcfsfKDDi3WpUR8nl3NvHSlecbW3vpn14CXOP9c09n6J++ vUXsCQyf/gflXrg6LMA9Y5FxrwJoCZ/ubKwOzoooMtVaFFfRYey4yRsmOTZIu2PKQiDO Kb2nnQ9i0uVNH3+cjBinrpwVUsSSU40Oj7vH23oujkLCUB01oYmvzULWJcmLXzMNdJvL utRQ== X-Gm-Message-State: ALoCoQnlXlILDsdLaXU0XLEaodB5MZodswmmSlFb2MDBqoAqlMhstZF6pT3at1FPFLxEwzEh+yov X-Received: by 10.66.4.71 with SMTP id i7mr607168pai.82.1376620017720; Thu, 15 Aug 2013 19:26:57 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qf7sm98613pac.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:57 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 09/34] cpufreq: dbx500: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:06 +0530 Message-Id: <6ce2b2cfc0c51c27ab27c4b4ff6d446debfd4dd9.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130815_222720_251197_9DE70719 X-CRM114-Status: GOOD ( 10.93 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , Linus Walleij , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Linus Walleij Signed-off-by: Viresh Kumar --- drivers/cpufreq/dbx500-cpufreq.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index d6d6b8c..060430c 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -22,28 +22,8 @@ static struct clk *armss_clk; static int dbx500_cpufreq_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; - int ret; - - freqs.old = policy->cur; - freqs.new = freq_table[index].frequency; - - /* pre-change notification */ - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - /* update armss clk frequency */ - ret = clk_set_rate(armss_clk, freqs.new * 1000); - - if (ret) { - pr_err("dbx500-cpufreq: Failed to set armss_clk to %d Hz: error %d\n", - freqs.new * 1000, ret); - freqs.new = freqs.old; - } - - /* post change notification */ - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - return ret; + return clk_set_rate(armss_clk, freq_table[index].frequency * 1000); } static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)