From patchwork Fri Aug 16 02:25:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19177 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 559922486D for ; Fri, 16 Aug 2013 02:26:22 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf509199qab.5 for ; Thu, 15 Aug 2013 19:26:22 -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=jDAJIaDW984yAzLnbx0HMxBRaMDwtr1QWqx0t1T7cbo=; b=iBK7Rhhk+D/DWWagNxJJPvU48nqJk7JOAAtmPgXH05B05R9FmFSOYMlDbmwzG9h5Zi Jvq4o2JqHpPmR0FhAR3ZE8dZqR4tFbyPOBQd/61iM+zYnNyjgsTdClZJGnLBPY1ppcEp wpyGxXO6lxsK2313MC7Kv6xddOlDYf9CKek6DGf8XeH84jYKsVkm+/mlQUtuYnpBL9Tn 4NG26qaf2PZCxM9hLHDfC+9X6TFUTjM09XFg4XXyPSG1eppXRRKADvI0FG0Ja6HHLCai d+WFuHZJjPpfr8fdrWn4z2Oyvwg5Unr2zo1tee1qDc7P7GD6IsRWlYebwnn5iv76YdUP q6vA== X-Received: by 10.236.222.228 with SMTP id t94mr355613yhp.18.1376619982059; Thu, 15 Aug 2013 19:26:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.129 with SMTP id k1ls589850qeh.75.gmail; Thu, 15 Aug 2013 19:26:21 -0700 (PDT) X-Received: by 10.58.198.13 with SMTP id iy13mr17322325vec.11.1376619981930; Thu, 15 Aug 2013 19:26:21 -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 gq6si647605veb.129.2013.08.15.19.26.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:21 -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 m1so1096228ves.41 for ; Thu, 15 Aug 2013 19:26:21 -0700 (PDT) X-Gm-Message-State: ALoCoQkBnBWL+4lcVU/1nsdtG+ACOcdQBGW4R6mTkr0fSMspWjzz8qKsUphAZm67GrcKwrlCsG1I X-Received: by 10.58.164.101 with SMTP id yp5mr17280251veb.0.1376619981841; Thu, 15 Aug 2013 19:26: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 u4csp45137vcz; Thu, 15 Aug 2013 19:26:21 -0700 (PDT) X-Received: by 10.68.239.42 with SMTP id vp10mr10766463pbc.164.1376619980948; Thu, 15 Aug 2013 19:26:20 -0700 (PDT) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by mx.google.com with ESMTPS id xq4si73184pab.28.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.52; Received: by mail-pb0-f52.google.com with SMTP id wz12so1457102pbc.39 for ; Thu, 15 Aug 2013 19:26:20 -0700 (PDT) X-Received: by 10.68.200.9 with SMTP id jo9mr18289121pbc.120.1376619980569; Thu, 15 Aug 2013 19:26:20 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ys4sm3047625pbb.9.2013.08.15.19.26.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26: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 , Hans-Christian Egtvedt Subject: [PATCH 04/34] cpufreq: at32ap: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:01 +0530 Message-Id: <1507bf552f7f9f61197c599236be870e739b337c.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.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: Hans-Christian Egtvedt Signed-off-by: Viresh Kumar Acked-by: Hans-Christian Egtvedt --- drivers/cpufreq/at32ap-cpufreq.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c index 81d0752..856ad80 100644 --- a/drivers/cpufreq/at32ap-cpufreq.c +++ b/drivers/cpufreq/at32ap-cpufreq.c @@ -37,27 +37,23 @@ static unsigned long loops_per_jiffy_ref; static int at32_set_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; + unsigned int old_freq, new_freq; - freqs.old = at32_get_speed(0); - freqs.new = freq_table[index].frequency; + old_freq = at32_get_speed(0); + new_freq = freq_table[index].frequency; if (!ref_freq) { - ref_freq = freqs.old; + ref_freq = old_freq; loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - if (freqs.old < freqs.new) + if (old_freq < new_freq) boot_cpu_data.loops_per_jiffy = cpufreq_scale( - loops_per_jiffy_ref, ref_freq, freqs.new); - clk_set_rate(cpuclk, freqs.new * 1000); - if (freqs.new < freqs.old) + loops_per_jiffy_ref, ref_freq, new_freq); + clk_set_rate(cpuclk, new_freq * 1000); + if (new_freq < old_freq) boot_cpu_data.loops_per_jiffy = cpufreq_scale( - loops_per_jiffy_ref, ref_freq, freqs.new); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - pr_debug("cpufreq: set frequency %u Hz\n", freqs.new * 1000); + loops_per_jiffy_ref, ref_freq, new_freq); return 0; }