From patchwork Sat Aug 10 06:44:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18960 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f200.google.com (mail-gh0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 50AC9246EB for ; Sat, 10 Aug 2013 06:51:09 +0000 (UTC) Received: by mail-gh0-f200.google.com with SMTP id 10sf2969590ghy.3 for ; Fri, 09 Aug 2013 23:51:09 -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=ICQN4h2h46Rw1m578TvL1UfrxF+2tEChB0g6wOWTauI=; b=h6B9+rH9aoVaIBJ/osBOgtP2N1i4KJHKQFUjSDN6Knat68BqOcMqJVvmVapGBg1SMJ jndRKV0eeS/Mtk3jic0kCqu70TONC73agOrjgdIg1DOCmxecsBiFjhV4Rj+A/eS46brc wkWkvBpwlMfdP9uKzYT9ObmSzZZlqulpg5WercvvyTlbFE3sz/dPccwMTdlw7YzUkjBO MtOJKyP/7QsBXowO90kfESmlHWYq6U+wcxtTb40VFLodKsCSSjznUK72gYTsv7HqXTip 5W4adIeuseCxFRR0V+QE0Ld9aRxAhOResB9+kaVaPWqDgACfrlzQQu2UKEgvnk3xL0nJ 3OuA== X-Received: by 10.236.220.5 with SMTP id n5mr6690624yhp.21.1376117469048; Fri, 09 Aug 2013 23:51:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.35 with SMTP id hp3ls1620681qeb.76.gmail; Fri, 09 Aug 2013 23:51:08 -0700 (PDT) X-Received: by 10.220.173.134 with SMTP id p6mr2241531vcz.36.1376117468936; Fri, 09 Aug 2013 23:51:08 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id q1si5680194vex.81.2013.08.09.23.51.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 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.46; Received: by mail-vb0-f46.google.com with SMTP id p13so4612484vbe.19 for ; Fri, 09 Aug 2013 23:51:08 -0700 (PDT) X-Gm-Message-State: ALoCoQm76RUecWNwlvcYcK68uer87nc8JSDRy+x9K5XKKGxSv4acVIeBpNrSruinPKHmazPl4Qtj X-Received: by 10.58.211.227 with SMTP id nf3mr2218680vec.20.1376117468857; Fri, 09 Aug 2013 23:51:08 -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 u4csp190vcz; Fri, 9 Aug 2013 23:51:08 -0700 (PDT) X-Received: by 10.68.106.67 with SMTP id gs3mr14963440pbb.126.1376117468066; Fri, 09 Aug 2013 23:51:08 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id zo4si14594385pbc.342.2013.08.09.23.51.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so3784642pad.5 for ; Fri, 09 Aug 2013 23:51:07 -0700 (PDT) X-Received: by 10.66.146.199 with SMTP id te7mr15056205pab.106.1376117467689; Fri, 09 Aug 2013 23:51:07 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ts6sm24179985pbc.12.2013.08.09.23.51.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:07 -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 , "David S. Miller" Subject: [PATCH 27/44] cpufreq: p4-clockmod: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:23 +0530 Message-Id: <73040a9b18c94d03b6501815b5aa62d069e8fd6b.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.212.46 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: David S. Miller Signed-off-by: Viresh Kumar --- drivers/cpufreq/p4-clockmod.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c index 03478bf..4fe6d4c 100644 --- a/drivers/cpufreq/p4-clockmod.c +++ b/drivers/cpufreq/p4-clockmod.c @@ -140,12 +140,6 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, } -static int cpufreq_p4_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &p4clockmod_table[0]); -} - - static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) { if (c->x86 == 0x06) { @@ -242,12 +236,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) } -static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - static unsigned int cpufreq_p4_get(unsigned int cpu) { u32 l, h; @@ -266,19 +254,14 @@ static unsigned int cpufreq_p4_get(unsigned int cpu) return stock_freq; } -static struct freq_attr *p4clockmod_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver p4clockmod_driver = { - .verify = cpufreq_p4_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = cpufreq_p4_target, .init = cpufreq_p4_cpu_init, - .exit = cpufreq_p4_cpu_exit, + .exit = cpufreq_generic_exit, .get = cpufreq_p4_get, .name = "p4-clockmod", - .attr = p4clockmod_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id cpufreq_p4_id[] = {