From patchwork Sat Aug 10 06:44:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18945 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83B9A246EB for ; Sat, 10 Aug 2013 06:49:17 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id o19sf637766qap.3 for ; Fri, 09 Aug 2013 23:49:17 -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=Tg2+F3hknkkjhgrAEJKIONYmSBfrkT9Kp0mlJjoj/tc=; b=eTvqg62DlTq61FX3YISrkV5aEoXd0PMM/AuXNUbFC/JgWm4qglN1dOE+PmO/Lw4HTs qLGUG474GgNxdHrhxXCWHmpTYmNVB2C/UiryE4rHIC3ONTctG/2JdanpTgiATuovkBz3 AllYiDOb9yLwov3rmb5De5XH8UWBzi2+Vf6A8Byzf80Watp98zCfxKKDOwhVn0QOuWBz srRVA5w2rm+nhlSjaCG6hFuI3YzN7BXWrMz3+DiY5imfeGfyKzwwQVYPFvkSi8VdZ7un xxk/hkuPG2pTrEaxo7LEGXNwb32oNJ2gHxmHeUMqP9wNuNdZ7omgVcnhGrJ6jehjE1wm zWtQ== X-Received: by 10.236.180.41 with SMTP id i29mr6745026yhm.1.1376117357296; Fri, 09 Aug 2013 23:49:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.175 with SMTP id s15ls1738512qeq.42.gmail; Fri, 09 Aug 2013 23:49:17 -0700 (PDT) X-Received: by 10.58.19.136 with SMTP id f8mr2162596vee.98.1376117357143; Fri, 09 Aug 2013 23:49:17 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id rx10si5669462vdc.151.2013.08.09.23.49.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id m17so1634736vca.3 for ; Fri, 09 Aug 2013 23:49:17 -0700 (PDT) X-Gm-Message-State: ALoCoQmzjpS0zrLgYhymYgUG9gIcStK+Opdb3C4TbSqWpbuqlRXFy+IsV0prKZWCuBbppUKlWmsS X-Received: by 10.52.117.208 with SMTP id kg16mr6592098vdb.48.1376117357050; Fri, 09 Aug 2013 23:49:17 -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 u4csp120vcz; Fri, 9 Aug 2013 23:49:16 -0700 (PDT) X-Received: by 10.66.162.195 with SMTP id yc3mr14891037pab.64.1376117356177; Fri, 09 Aug 2013 23:49:16 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id zs4si14635395pbb.166.2013.08.09.23.49.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kl13so5699962pab.6 for ; Fri, 09 Aug 2013 23:49:15 -0700 (PDT) X-Received: by 10.66.21.37 with SMTP id s5mr15159848pae.103.1376117355790; Fri, 09 Aug 2013 23:49:15 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qc5sm24136981pbc.31.2013.08.09.23.49.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:15 -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 , Steven Miao Subject: [PATCH 12/44] cpufreq: blackfin: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:08 +0530 Message-Id: <31c535b3b686faf04ca231c365a212032938cd97.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.220.172 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: Steven Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/blackfin-cpufreq.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c index 84d446a..48888cf 100644 --- a/drivers/cpufreq/blackfin-cpufreq.c +++ b/drivers/cpufreq/blackfin-cpufreq.c @@ -191,11 +191,6 @@ static int bfin_target(struct cpufreq_policy *policy, return ret; } -static int bfin_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, bfin_freq_table); -} - static int __bfin_cpu_init(struct cpufreq_policy *policy) { @@ -213,25 +208,14 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy) return cpufreq_table_validate_and_show(policy, bfin_freq_table); } -static int __bfin_cpu_exit(struct cpufreq_policy *policy) -{ - - cpufreq_frequency_table_put_attr(policy->cpu); -} - -static struct freq_attr *bfin_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver bfin_driver = { - .verify = bfin_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = bfin_target, .get = bfin_getfreq_khz, .init = __bfin_cpu_init, - .exit = __bfin_cpu_exit, + .exit = cpufreq_generic_exit, .name = "bfin cpufreq", - .attr = bfin_freq_attr, + .attr = cpufreq_generic_attr, }; static int __init bfin_cpu_init(void)