From patchwork Sat Aug 10 06:44: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: 18947 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4DBA246EB for ; Sat, 10 Aug 2013 06:49:37 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l12sf330846yen.2 for ; Fri, 09 Aug 2013 23:49:37 -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=kLe1pewGz8hGSyZXNS56S8AzQD4oUttDlRb7RH3kjMw=; b=GXQcFQqrfZMSTwUyeNTl5wo8T78EKS8Zn5rNU2bb5RbGE9VaBO8J4O0xX/h9ec3BYW vkNJ/8VTzKtiTtXhWR1HKUbp5cMoS9lYn+nHQConqVvnH/76bMjlgGYIAAo1YDtqtujA 2h6oumUWN5BAQXv+JuHHCmvqTY8zQDHTCShs9aXvPv7gqyEwnzh3Cga3KAQdwVI8zwbv KbbvMYoJ+81QtUqAuCN62zn3bi2aSOZ86ZGti53WDWwofRIGRFnbPWnUxy21A3NQ+kbc NNLOxPkApZtBiumFwqXWTJpWULiNg7kpGMgbDWUGr0YrxXs/ti2pTk1TfSp+Te7289tV wbHg== X-Received: by 10.236.91.4 with SMTP id g4mr6828881yhf.30.1376117377424; Fri, 09 Aug 2013 23:49:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.129 with SMTP id ke1ls1588568qeb.88.gmail; Fri, 09 Aug 2013 23:49:37 -0700 (PDT) X-Received: by 10.58.197.5 with SMTP id iq5mr2210444vec.30.1376117377254; Fri, 09 Aug 2013 23:49:37 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id b1si5681085veg.61.2013.08.09.23.49.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.180; Received: by mail-ve0-f180.google.com with SMTP id pb11so4469848veb.39 for ; Fri, 09 Aug 2013 23:49:37 -0700 (PDT) X-Gm-Message-State: ALoCoQnR3uCDUXJT4nB6AZAfPmDgvVagV/00RBmePQG/iY2AQNcQhklE7JbyOZnDRSgWo6K0Nx6E X-Received: by 10.58.6.210 with SMTP id d18mr2143458vea.96.1376117377161; Fri, 09 Aug 2013 23:49:37 -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 u4csp131vcz; Fri, 9 Aug 2013 23:49:36 -0700 (PDT) X-Received: by 10.67.1.203 with SMTP id bi11mr4212858pad.137.1376117376278; Fri, 09 Aug 2013 23:49:36 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id xx2si7265889pac.285.2013.08.09.23.49.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id g10so1400689pdj.12 for ; Fri, 09 Aug 2013 23:49:35 -0700 (PDT) X-Received: by 10.66.250.47 with SMTP id yz15mr15046476pac.154.1376117375891; Fri, 09 Aug 2013 23:49:35 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id yk8sm9367610pab.11.2013.08.09.23.49.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:35 -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 , Jesper Nilsson , Mikael Starvik , linux-cris-kernel@axis.com Subject: [PATCH 14/44] cpufreq: cris: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:10 +0530 Message-Id: <64ef4787424287543c4dccc572785cc758e37b78.1376116345.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.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. Cc: Jesper Nilsson Cc: Mikael Starvik Cc: linux-cris-kernel@axis.com Signed-off-by: Viresh Kumar --- drivers/cpufreq/cris-artpec3-cpufreq.c | 23 +++-------------------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 22 +++------------------- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/drivers/cpufreq/cris-artpec3-cpufreq.c b/drivers/cpufreq/cris-artpec3-cpufreq.c index 444fd96..d26f4e4 100644 --- a/drivers/cpufreq/cris-artpec3-cpufreq.c +++ b/drivers/cpufreq/cris-artpec3-cpufreq.c @@ -54,11 +54,6 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int cris_freq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]); -} - static int cris_freq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -84,26 +79,14 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy) } -static int cris_freq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - - -static struct freq_attr *cris_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver cris_freq_driver = { .get = cris_freq_get_cpu_frequency, - .verify = cris_freq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = cris_freq_target, .init = cris_freq_cpu_init, - .exit = cris_freq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "cris_freq", - .attr = cris_freq_attr, + .attr = cpufreq_generic_attr, }; static int __init cris_freq_init(void) diff --git a/drivers/cpufreq/cris-etraxfs-cpufreq.c b/drivers/cpufreq/cris-etraxfs-cpufreq.c index 428395e..d384e63 100644 --- a/drivers/cpufreq/cris-etraxfs-cpufreq.c +++ b/drivers/cpufreq/cris-etraxfs-cpufreq.c @@ -54,11 +54,6 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int cris_freq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]); -} - static int cris_freq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { @@ -82,25 +77,14 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy) return cpufreq_table_validate_and_show(policy, cris_freq_table); } -static int cris_freq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *cris_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver cris_freq_driver = { .get = cris_freq_get_cpu_frequency, - .verify = cris_freq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = cris_freq_target, .init = cris_freq_cpu_init, - .exit = cris_freq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "cris_freq", - .attr = cris_freq_attr, + .attr = cpufreq_generic_attr, }; static int __init cris_freq_init(void)