From patchwork Fri Sep 13 13:02:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20263 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6267620358 for ; Fri, 13 Sep 2013 13:27:56 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q5sf1174577yen.0 for ; Fri, 13 Sep 2013 06:27:56 -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=7OH10803MWbiq6UkHpkpmbzDhcow/mTLClem9XGUfWk=; b=I1t7RB9xrm88/+fcgHVrhCsDGJ916tOZYkzWcGZ1Tp6OS3xJYoqfnvjTq46v4gHs2U e4B1cvOKvnxPAruBr8XKLsg1RF0L+vsBEOJsg8tBKYxtGknyitGDlhRuSKcZGaI7nnKu JMceR7N1VhJiwqi7kog5cBkJYVp6EBsCRizHYC6h3SyJFqS4FIj0ezQKwfi4stWe6I3Z wUIL8IYigWQjc2/ZnW+/XdLUdtwYdcGosdX/Ag2vRmI3aT1wajrxl1sXni2kCg8OaWzr 7vojj9vbIkCocCRoVZQlv47wht4kJ5cZTlSmHh2+2DtJUA4WXmt1OglUBmq/BNQfQBsC w8KA== X-Gm-Message-State: ALoCoQmZFG8NLZPl+F3wiBpo7WlP2LPLImLtd+juj6a81ybvcEp20ubcOsNegejQ+3Z6ZDQMLewL X-Received: by 10.236.80.42 with SMTP id j30mr4930899yhe.29.1379078876177; Fri, 13 Sep 2013 06:27:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.10 with SMTP id em10ls1113603qeb.82.gmail; Fri, 13 Sep 2013 06:27:56 -0700 (PDT) X-Received: by 10.220.237.208 with SMTP id kp16mr11959605vcb.4.1379078875957; Fri, 13 Sep 2013 06:27:55 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id x9si3122447vec.80.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so942431veb.41 for ; Fri, 13 Sep 2013 06:27:55 -0700 (PDT) X-Received: by 10.58.197.5 with SMTP id iq5mr412575vec.30.1379078875865; Fri, 13 Sep 2013 06:27:55 -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 u4csp80741vcz; Fri, 13 Sep 2013 06:27:55 -0700 (PDT) X-Received: by 10.67.23.227 with SMTP id id3mr15507371pad.101.1379078874842; Fri, 13 Sep 2013 06:27:54 -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 hk5si11279458pac.38.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:54 -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 y10so1238217pdj.39 for ; Fri, 13 Sep 2013 06:27:54 -0700 (PDT) X-Received: by 10.66.230.138 with SMTP id sy10mr15530216pac.103.1379078874429; Fri, 13 Sep 2013 06:27:54 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id qp10sm18107735pab.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:53 -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 209/228] cpufreq: SPEAr: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:35 +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.128.182 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 0326040..658cfe7 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; }