From patchwork Sat Aug 10 06:44:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18963 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7AAED246EB for ; Sat, 10 Aug 2013 06:51:30 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf5839081yhq.9 for ; Fri, 09 Aug 2013 23:51:30 -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=Oi+l/JMg9aDdl+bml/M07OQdkZn5ogOY1eqEPkBgf2I=; b=R24i3m17H2PWxO2W+1SXHrf+xt5uOajAlgOZTOQ6zhQqbU3NQCPIPwvEic+XOuqz27 9WxClaLFO0WU1B2XfJV4cpQDvbO4s6NH0CNbmg0lr7GfL62B2BNL3lQY9nGA70ynhjeg xn9OXPAW4VBpouQP+/JhKLa7s/DZY8K9BIhyOJy7u+U1/v3b81Cao3UfvGmj7js1YOah lHuKh7GWwEpNA/Umy2Wss8MAIrNsf9c4hy/LXs0eVshkabVuxKyWMqvCY0Q+KIKzzT+c OKl46HP5getjBwdkp0gJBnicjTSlUQNKx9YAAYRVtv7KCD5qUO9bcD+4pU7GG1nOBrHm VydQ== X-Received: by 10.236.207.169 with SMTP id n29mr6780684yho.50.1376117490215; Fri, 09 Aug 2013 23:51:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.137 with SMTP id l9ls1794830qev.0.gmail; Fri, 09 Aug 2013 23:51:30 -0700 (PDT) X-Received: by 10.58.108.8 with SMTP id hg8mr2238385veb.6.1376117490037; Fri, 09 Aug 2013 23:51:30 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id gr9si5672791vec.149.2013.08.09.23.51.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so1603716vcb.25 for ; Fri, 09 Aug 2013 23:51:30 -0700 (PDT) X-Gm-Message-State: ALoCoQl7G8Mb5Eebdf3hYukoZgMagIOAp++at+NthHYUV8pwS9SHSYl2wKMZzNALgq1dyh9Dv+vg X-Received: by 10.58.134.84 with SMTP id pi20mr5959066veb.55.1376117489954; Fri, 09 Aug 2013 23:51:29 -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 u4csp207vcz; Fri, 9 Aug 2013 23:51:29 -0700 (PDT) X-Received: by 10.66.142.107 with SMTP id rv11mr15260750pab.17.1376117488978; Fri, 09 Aug 2013 23:51:28 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id pq9si14601149pbc.322.2013.08.09.23.51.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so1388112pdi.5 for ; Fri, 09 Aug 2013 23:51:28 -0700 (PDT) X-Received: by 10.68.197.226 with SMTP id ix2mr4233153pbc.149.1376117488393; Fri, 09 Aug 2013 23:51:28 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id om2sm24152744pbc.30.2013.08.09.23.51.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:27 -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 Subject: [PATCH 30/44] cpufreq: pmac: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:26 +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.220.180 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 CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines for this driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/pmac32-cpufreq.c | 14 ++------------ drivers/cpufreq/pmac64-cpufreq.c | 14 ++------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index 0b3efdb..3f8efd2 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -85,11 +85,6 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = { {0, CPUFREQ_TABLE_END}, }; -static struct freq_attr* pmac_cpu_freqs_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static inline void local_delay(unsigned long ms) { if (no_schedule) @@ -377,11 +372,6 @@ static unsigned int pmac_cpufreq_get_speed(unsigned int cpu) return cur_freq; } -static int pmac_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs); -} - static int pmac_cpufreq_target( struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -467,14 +457,14 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy) } static struct cpufreq_driver pmac_cpufreq_driver = { - .verify = pmac_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = pmac_cpufreq_target, .get = pmac_cpufreq_get_speed, .init = pmac_cpufreq_cpu_init, .suspend = pmac_cpufreq_suspend, .resume = pmac_cpufreq_resume, .flags = CPUFREQ_PM_NO_WARN, - .attr = pmac_cpu_freqs_attr, + .attr = cpufreq_generic_attr, .name = "powermac", }; diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c index 366be61..0eb9313 100644 --- a/drivers/cpufreq/pmac64-cpufreq.c +++ b/drivers/cpufreq/pmac64-cpufreq.c @@ -69,11 +69,6 @@ static struct cpufreq_frequency_table g5_cpu_freqs[] = { {0, CPUFREQ_TABLE_END}, }; -static struct freq_attr* g5_cpu_freqs_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - /* Power mode data is an array of the 32 bits PCR values to use for * the various frequencies, retrieved from the device-tree */ @@ -316,11 +311,6 @@ static int g5_pfunc_query_freq(void) * Common interface to the cpufreq core */ -static int g5_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, g5_cpu_freqs); -} - static int g5_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { @@ -371,10 +361,10 @@ static struct cpufreq_driver g5_cpufreq_driver = { .name = "powermac", .flags = CPUFREQ_CONST_LOOPS, .init = g5_cpufreq_cpu_init, - .verify = g5_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = g5_cpufreq_target, .get = g5_cpufreq_get_speed, - .attr = g5_cpu_freqs_attr, + .attr = cpufreq_generic_attr, };