From patchwork Fri Sep 13 13:00:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2890411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E68D39F1C0 for ; Fri, 13 Sep 2013 15:58:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBCB3202E8 for ; Fri, 13 Sep 2013 15:58:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05DC5202CA for ; Fri, 13 Sep 2013 15:57:59 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKTJP-0006gv-Ol; Fri, 13 Sep 2013 13:21:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKTIq-0007nj-1o; Fri, 13 Sep 2013 13:20:52 +0000 Received: from mail-pb0-f45.google.com ([209.85.160.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKTBW-0006gR-D5 for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2013 13:13:19 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc17so1221942pbc.4 for ; Fri, 13 Sep 2013 06:12:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=hzBK3KEtY1xjT6sk/SCL8r10V1PB6Lm/Tp8JdwM8NzI=; b=Nc0awC+jJvOY1fpb0XwWrgKNd7ZB5dKEge4WxNkywBvc/5xpEiahhhJ0tdYMvcwJw5 ZuWYkHNRZk/PQEwm+JqBtYqBKSxH9bw1h1gZLKXCBMB+ssqm6IgshULaG7Ec7WcoGmxM OjbtS4T157rp+3f/eR2noz+CI1uZ0sdBwkUtDfNisqhOCACYaWA24ZBjm3PnyU69ehiU EGIttnPl9P+Fu/SzTjxW+sSYUs04jnSM6xhQvfKPE/ANua0wVP0PBg6PZfbMmx1DYqUl hlxDYXYGNh82i6897eyn6hL/NAIBGHOXl8JqXBtBhmJQFohP84GjZ4fplOL136/AqGQM 5erg== X-Gm-Message-State: ALoCoQlix2qb5WK6gYj2HroeP86lMkjc+V0MPyzKUN+x/Iri26ylAaWCThfuOUNQSgiUBsyHItqF X-Received: by 10.66.25.133 with SMTP id c5mr15200647pag.4.1379077977470; Fri, 13 Sep 2013 06:12:57 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id wd6sm18054168pab.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:56 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 084/228] cpufreq: sc520: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:30 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130913_091318_626356_59833084 X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/sc520_freq.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index bb9c0de..8556225 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -78,11 +78,6 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int sc520_freq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); -} - static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -120,27 +115,14 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) } -static int sc520_freq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - - -static struct freq_attr *sc520_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - - static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, - .verify = sc520_freq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = sc520_freq_target, .init = sc520_freq_cpu_init, - .exit = sc520_freq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "sc520_freq", - .attr = sc520_freq_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id sc520_ids[] = {