From patchwork Fri Sep 13 13:00:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20128 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6AFE920358 for ; Fri, 13 Sep 2013 13:11:49 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gd11sf1200521vcb.0 for ; Fri, 13 Sep 2013 06:11:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=lkUknfujGjNsMUckKKIuQPsyXxf1BtZAgCWpT7/EXavHPxWRdTcpN2An57RehYkJpP PTsPJU0ONHg4kBF0e6urtCQafZbUOwq4G4JrPaTBCxZAx5Gomu5WnVKM7b65CaHYKdjm oJ6MuAH+Nceo+zgiRwvkeNlLG6PasNo+wb6ki6mWXLdGCO/1ST3Av/xTCqKv6IAKzcJo 6pCzB62elGMnQr1YT11d3uLp4d7Cia0IjZUiGJ72owqJ0+YZW2vN72ojntbJ8dSpsONG 3fH7wJGYvO/N8gKMF32P+bOC5Lpt1Doazml/OJWsT6tpSc8v4RHe+Jofnm4P4NV4N6BM A1lQ== X-Gm-Message-State: ALoCoQm/IMX6VJiz5DnS6shVIQJXrRbh2SLHvHQb6k5mLwK11LFxaXes5HOMOh07F9Xqswz/HeGE X-Received: by 10.236.124.33 with SMTP id w21mr4950024yhh.15.1379077909191; Fri, 13 Sep 2013 06:11:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.5 with SMTP id b5ls1125300qel.70.gmail; Fri, 13 Sep 2013 06:11:49 -0700 (PDT) X-Received: by 10.58.168.205 with SMTP id zy13mr10016773veb.19.1379077908959; Fri, 13 Sep 2013 06:11:48 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id c11si3108961vej.52.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id lf11so890682vcb.21 for ; Fri, 13 Sep 2013 06:11:48 -0700 (PDT) X-Received: by 10.58.75.131 with SMTP id c3mr8502284vew.12.1379077908883; Fri, 13 Sep 2013 06:11:48 -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 u4csp79890vcz; Fri, 13 Sep 2013 06:11:48 -0700 (PDT) X-Received: by 10.66.14.3 with SMTP id l3mr8878514pac.162.1379077907743; Fri, 13 Sep 2013 06:11:47 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id to1si11143013pab.283.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id uo5so1221265pbc.37 for ; Fri, 13 Sep 2013 06:11:47 -0700 (PDT) X-Received: by 10.68.181.132 with SMTP id dw4mr2019271pbc.179.1379077907343; Fri, 13 Sep 2013 06:11:47 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id xv2sm5641382pbb.39.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:46 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar , "David S. Miller" Subject: [PATCH 074/228] cpufreq: p4-clockmod: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:20 +0530 Message-Id: <362d9c2397b31d84171f9d6cc5b35357f2542199.1379063063.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.176 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[] = {