From patchwork Fri Sep 13 13:02:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20238 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B92C520358 for ; Fri, 13 Sep 2013 13:24:56 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m11sf1168568yen.1 for ; Fri, 13 Sep 2013 06:24: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=5y6b/vM5fHqDNBmrqdG0NnsiHv/Xbib9pPkdkKEHIC4=; b=A5MfJx7mRIJzlakJzHc5VENs3vV/l7J/cn5RWGbXVX1u13h5+Q1RPiQLhUSl8v9Cl0 1mngq5SGfAI0kdCjHx3Q5Ae0eHtg286rxdIapWbSuLEWTGOWMxovJl5buo4xOulnC9Hj U5F253f+YCDvhz4qaWS39kum/Be7iiZ1C1nL8GjwV/xWH6WHvCsCsdG9tFrOd/mhrN+a gCFCgOu6TT2kv575p7XK8XC3rX9mC6OXZbBoti4t/o5/v2nwYY6N+KkXJNj6yXTiYF6x MxCaDbjSJmWPBlNpzQojtOVjjMw1XNs2guBL1V346xte8CH1xGrZ4j9FIaZnVTjcTPHb Nlbw== X-Gm-Message-State: ALoCoQmPfFAl40/oOVgc+s0AJX87Cfjz2DOYms0tVu0t3oKmbgWg0crVvzSslZzh0h6G2yktGG19 X-Received: by 10.236.108.233 with SMTP id q69mr5020996yhg.11.1379078696505; Fri, 13 Sep 2013 06:24:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.62.72 with SMTP id w8ls1159734qer.2.gmail; Fri, 13 Sep 2013 06:24:56 -0700 (PDT) X-Received: by 10.52.0.108 with SMTP id 12mr42515vdd.45.1379078696265; Fri, 13 Sep 2013 06:24:56 -0700 (PDT) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id ee5si3129749vec.40.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.54; Received: by mail-vb0-f54.google.com with SMTP id q14so898146vbe.41 for ; Fri, 13 Sep 2013 06:24:56 -0700 (PDT) X-Received: by 10.220.164.70 with SMTP id d6mr11834639vcy.19.1379078696174; Fri, 13 Sep 2013 06:24:56 -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 u4csp80584vcz; Fri, 13 Sep 2013 06:24:55 -0700 (PDT) X-Received: by 10.68.242.1 with SMTP id wm1mr13520753pbc.57.1379078695214; Fri, 13 Sep 2013 06:24:55 -0700 (PDT) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id ar2si7488974pbc.52.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.54; Received: by mail-pb0-f54.google.com with SMTP id ro12so1238664pbb.27 for ; Fri, 13 Sep 2013 06:24:54 -0700 (PDT) X-Received: by 10.68.200.9 with SMTP id jo9mr13258095pbc.120.1379078694721; Fri, 13 Sep 2013 06:24:54 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id ct4sm11735576pbb.41.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:54 -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 Subject: [PATCH 184/228] cpufreq: at32ap: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:10 +0530 Message-Id: <07166d286c4258080a35f4fcb406761c3c490cac.1379063063.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.212.54 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. Acked-by: Hans-Christian Egtvedt Signed-off-by: Viresh Kumar --- 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; }