From patchwork Wed Aug 14 13:31:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19117 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 927432390D for ; Wed, 14 Aug 2013 13:33:16 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q8sf4533955yen.0 for ; Wed, 14 Aug 2013 06:33:16 -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=fz/D4p1RZcNffj2NM1Lyga30EE0L71mHPexi9FVCB5I=; b=d8WX/sKwataP64paBn0VWy2YH35PAtEe8qNwNMa5G4PvxDQLq3wYGQPwxW+x3/5qVX EHGxadWFgcbj9QWwY+KjBtMPND4rW3peusbuuspahCTizHsireAfxwhJ+IvjmbsJ3v9p 7TIh+kSdlavT1UVofTPZbGekE44Uuz2QiSL0lUHcCFq4E7BeXQab1mhM9R6EJjvQ3Eae tI4VBhzoTQVphxbMUP8xhmyGYIZ5FySa9O0hpuTOZY1MZZTW6atBHz2aV68avsfHLt77 h6h36Ly2e/P8VihKe+wuPEmKajjogIty4lt5a2jCTsuKFUIIuapxHaKytaAYDFHHuIx4 LZwQ== X-Received: by 10.58.18.180 with SMTP id x20mr2115971ved.38.1376487196261; Wed, 14 Aug 2013 06:33:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.195 with SMTP id lm3ls3246663qeb.89.gmail; Wed, 14 Aug 2013 06:33:16 -0700 (PDT) X-Received: by 10.221.56.194 with SMTP id wd2mr9835517vcb.7.1376487196146; Wed, 14 Aug 2013 06:33:16 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id q4si9688105vce.49.2013.08.14.06.33.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:33:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 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.41; Received: by mail-vb0-f41.google.com with SMTP id g17so7729461vbg.0 for ; Wed, 14 Aug 2013 06:33:16 -0700 (PDT) X-Gm-Message-State: ALoCoQmmjXGwVD1NCSuUWiwzrdD9ols3MgqZcK0eh8u7wiaKppOQIGBAiAPM1yQtvg76YbjIkpcd X-Received: by 10.220.198.133 with SMTP id eo5mr9700507vcb.24.1376487196053; Wed, 14 Aug 2013 06:33:16 -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 u4csp213053vcz; Wed, 14 Aug 2013 06:33:15 -0700 (PDT) X-Received: by 10.66.227.2 with SMTP id rw2mr9968237pac.131.1376487195104; Wed, 14 Aug 2013 06:33:15 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id zo6si10836755pac.286.2013.08.14.06.33.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:33:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id r10so5732294pdi.27 for ; Wed, 14 Aug 2013 06:33:14 -0700 (PDT) X-Received: by 10.66.169.42 with SMTP id ab10mr10022119pac.14.1376487194703; Wed, 14 Aug 2013 06:33:14 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id hk3sm8844240pbb.3.2013.08.14.06.33.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:33:14 -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, Viresh Kumar , Hans-Christian Egtvedt Subject: [PATCH 04/37] cpufreq: at32ap: don't initialize part of policy that is set by core too Date: Wed, 14 Aug 2013 19:01:53 +0530 Message-Id: <6fe9b31a6e199052e0a91b38c8f6d110e9f57b28.1376486713.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.41 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(). Cc: Hans-Christian Egtvedt Signed-off-by: Viresh Kumar Acked-by: Hans-Christian Egtvedt --- 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 bae6ed8..81d0752 100644 --- a/drivers/cpufreq/at32ap-cpufreq.c +++ b/drivers/cpufreq/at32ap-cpufreq.c @@ -64,7 +64,7 @@ static int at32_set_target(struct cpufreq_policy *policy, unsigned int index) 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) @@ -77,12 +77,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 @@ -91,7 +88,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) { @@ -99,7 +96,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;