From patchwork Sat Aug 10 06:44:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18946 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC6D6246EB for ; Sat, 10 Aug 2013 06:49:24 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id s1sf6010907qcw.8 for ; Fri, 09 Aug 2013 23:49:24 -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=K3/ae6KBsIARgBmVZ2wa3TOtxAlN5ZYw+fGwDzlhSFE=; b=UJFVjwspkxXdLi7Pkt+KFYobN6Gq3SvphrVojLkEs9oeZOEtbLK60Is+eIAzZ06MzM D9GbBVsyPzcRLxc/FbU/1h0aQSBLTJxdEYjhrCKCo38w5XX+yRCIar6TSlx49hQ5dJIa sbQPMHLeTsQtmbQDIA7EWdpD0hfPfql2emfm+G3upK4YbJ4SnGsZbZxZ/U5DjSZdP0Uf vtxuzYrxGgDJE8VhB7xAGz4SPelXHH4g2cgt9W7A1HjmOdU90F+P2FjZse8y9dayaohz H9bXGZot1Lg3GSBFrFLe0UlZ/IiVNbsJFzcy+gu3bJ41dy9CriwrQTXj3PVVUC1XlWio OcRA== X-Received: by 10.236.41.163 with SMTP id h23mr4773745yhb.0.1376117364582; Fri, 09 Aug 2013 23:49:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.244 with SMTP id u20ls1690277qeq.74.gmail; Fri, 09 Aug 2013 23:49:24 -0700 (PDT) X-Received: by 10.220.98.212 with SMTP id r20mr2186722vcn.48.1376117364487; Fri, 09 Aug 2013 23:49:24 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id ey4si5682574vcb.47.2013.08.09.23.49.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 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.43; Received: by mail-vb0-f43.google.com with SMTP id h11so4597871vbh.2 for ; Fri, 09 Aug 2013 23:49:24 -0700 (PDT) X-Gm-Message-State: ALoCoQkdZPKyylW+SGRxHqhh2oG+CS6CCFuw9X+xDhBXWE0uRJVUqhQckheglxiBahmETGFhathz X-Received: by 10.58.128.71 with SMTP id nm7mr7680002veb.51.1376117364406; Fri, 09 Aug 2013 23:49:24 -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 u4csp123vcz; Fri, 9 Aug 2013 23:49:23 -0700 (PDT) X-Received: by 10.66.144.104 with SMTP id sl8mr4306898pab.9.1376117363365; Fri, 09 Aug 2013 23:49:23 -0700 (PDT) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id dw1si14637782pbc.156.2013.08.09.23.49.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.45; Received: by mail-pb0-f45.google.com with SMTP id mc17so5211942pbc.32 for ; Fri, 09 Aug 2013 23:49:23 -0700 (PDT) X-Received: by 10.66.142.107 with SMTP id rv11mr15255578pab.17.1376117362953; Fri, 09 Aug 2013 23:49:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ll5sm26634825pab.19.2013.08.09.23.49.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:22 -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 , Shawn Guo Subject: [PATCH 13/44] cpufreq: cpu0: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:09 +0530 Message-Id: <3978525eb8c4b042fd399bb506d3d59960680538.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.43 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: Shawn Guo Signed-off-by: Viresh Kumar Acked-by: Shawn Guo --- drivers/cpufreq/cpufreq-cpu0.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 65d70a3..3d24e7b 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -29,11 +29,6 @@ static struct clk *cpu_clk; static struct regulator *cpu_reg; static struct cpufreq_frequency_table *freq_table; -static int cpu0_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, freq_table); -} - static unsigned int cpu0_get_speed(unsigned int cpu) { return clk_get_rate(cpu_clk) / 1000; @@ -147,27 +142,15 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int cpu0_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - - return 0; -} - -static struct freq_attr *cpu0_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver cpu0_cpufreq_driver = { .flags = CPUFREQ_STICKY, - .verify = cpu0_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = cpu0_set_target, .get = cpu0_get_speed, .init = cpu0_cpufreq_init, - .exit = cpu0_cpufreq_exit, + .exit = cpufreq_generic_exit, .name = "generic_cpu0", - .attr = cpu0_cpufreq_attr, + .attr = cpufreq_generic_attr, }; static int cpu0_cpufreq_probe(struct platform_device *pdev)