From patchwork Fri Sep 13 13:00:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20147 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5D06120358 for ; Fri, 13 Sep 2013 13:14:02 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ht10sf1199723vcb.1 for ; Fri, 13 Sep 2013 06:14:02 -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=8gHEOorOM4g8oDDO42tAK1WMGk59Yi5yUYs/xwKLtA0=; b=X43j7JEl66v1LZaoArVd+SZyQe9fhpb9noNsdKMhrqYTu+ooSQANw5p5O35n4ahVdr lXr8SbipP2EvcGp+rJZquQYkMsie4d2rykS7J/KVfnLJr3mMpdtZJb9YK8QMvitqQLAZ r509Fpdsp3ROP5Zgb4Kw+62PDOQwsW7eFjT3C0+wZAb2FK+4e5RyXM+LSCn3GUYSb/4o 4DmOQ9KONCjY9P93ihiMzikE9wPQdljzdB5abej6BGFzF0MMvB7+T3Gmj3kzBfn0/Sn3 +mbeo470fRqgS1y1yE+4XiET+ouDgb5298BIpfQSImQsAfDfiT0lA8WblSeHpyITKGub IC6w== X-Gm-Message-State: ALoCoQn/DHs7JsL2cz0QaynhyQeFY7v6rg5TPTgRwM44Qc9EyEYHgfSmYUyU5AH8QFHIayLfgGZh X-Received: by 10.236.174.232 with SMTP id x68mr5158312yhl.42.1379078042117; Fri, 13 Sep 2013 06:14:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.107.136 with SMTP id hc8ls1116130qeb.55.gmail; Fri, 13 Sep 2013 06:14:01 -0700 (PDT) X-Received: by 10.52.164.102 with SMTP id yp6mr10378810vdb.14.1379078041894; Fri, 13 Sep 2013 06:14:01 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id b5si3100933vel.100.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:14:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so887643vcb.26 for ; Fri, 13 Sep 2013 06:14:01 -0700 (PDT) X-Received: by 10.52.122.68 with SMTP id lq4mr10108925vdb.21.1379078041818; Fri, 13 Sep 2013 06:14:01 -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 u4csp79978vcz; Fri, 13 Sep 2013 06:14:01 -0700 (PDT) X-Received: by 10.66.142.132 with SMTP id rw4mr12881870pab.6.1379078040891; Fri, 13 Sep 2013 06:14:00 -0700 (PDT) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id fl1si11177888pab.199.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:14:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so1221222pbb.33 for ; Fri, 13 Sep 2013 06:14:00 -0700 (PDT) X-Received: by 10.68.224.161 with SMTP id rd1mr13455537pbc.121.1379078040466; Fri, 13 Sep 2013 06:14:00 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id sy2sm11705441pbc.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:13:59 -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 093/228] cpufreq: at32ap: don't initialize part of policy that is set by core too Date: Fri, 13 Sep 2013 18:30:39 +0530 Message-Id: <555cf20f110c47446ee8a2850703862d6fa88e6b.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.220.181 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: , Many common initializations of struct policy are moved to core now and hence this driver doesn't need to do it. This patch removes such code. Most recent of those changes is to call ->get() in the core after calling ->init(). Acked-by: Hans-Christian Egtvedt Signed-off-by: Viresh Kumar --- drivers/cpufreq/at32ap-cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c index 788f7e7..7439ded 100644 --- a/drivers/cpufreq/at32ap-cpufreq.c +++ b/drivers/cpufreq/at32ap-cpufreq.c @@ -77,7 +77,7 @@ static int at32_set_target(struct cpufreq_policy *policy, static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy) { - unsigned int frequency, rate; + unsigned int frequency, rate, min_freq; int retval, steps, i; if (policy->cpu != 0) @@ -90,12 +90,9 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy) goto out_err; } - policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; - policy->cpuinfo.max_freq = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; + min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; + frequency = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; policy->cpuinfo.transition_latency = 0; - policy->cur = at32_get_speed(0); - policy->min = policy->cpuinfo.min_freq; - policy->max = policy->cpuinfo.max_freq; /* * AVR32 CPU frequency rate scales in power of two between maximum and @@ -104,7 +101,7 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy) * Further validate that the frequency is usable, and append it to the * frequency table. */ - steps = fls(policy->cpuinfo.max_freq / policy->cpuinfo.min_freq) + 1; + steps = fls(frequency / min_freq) + 1; freq_table = kzalloc(steps * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); if (!freq_table) { @@ -112,7 +109,6 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy) goto out_err_put_clk; } - frequency = policy->cpuinfo.max_freq; for (i = 0; i < (steps - 1); i++) { rate = clk_round_rate(cpuclk, frequency * 1000) / 1000;