From patchwork Fri Sep 13 13:00:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20141 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7C5E20358 for ; Fri, 13 Sep 2013 13:13:20 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id l13sf1201848qcy.1 for ; Fri, 13 Sep 2013 06:13:20 -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=oJD2R6rBo62OQFyYmLe7z1YRH47LjQqMCW7j/OQyERo=; b=KkWvkIs5x4te/6xw/hprP/PcZC+gs4xu6QePBDiW6kSdmQlc8ZjSqp845+45eOT3dV ytgsOaa7Bv+n1j/ZrCYHQr9j3E6Wp+6AO0q4kOxQV8CrGpTTZIqekxLjQtcVDlzXMkPf NAAMHhm4+rRVrbxMR6K8guA0f8dMmrfQSKElifclVIlcHGmA1sF2M8FdbC2Nw78nmRZd dhElS0IwS7IeSgkdfQ3884q90QK2ZIUsLMmny9dmPAvz15owa8bRt+HJ8j/sUmPYpGEg XCtZLse5gnA4FES6hykCQpVOf6GuO2nuBBxThvA8sz4NdfSUspjgKc+YWHP0uUQcAhms RLDA== X-Gm-Message-State: ALoCoQknLWYu5tLPoEdYsma9nUNy0HxjmbDuWXOmntNDOS0vEPvwZ9chpXD/cFQbEF8uWRVVOwGb X-Received: by 10.236.56.70 with SMTP id l46mr5346865yhc.2.1379078000579; Fri, 13 Sep 2013 06:13:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.41 with SMTP id 9ls1240955qeb.15.gmail; Fri, 13 Sep 2013 06:13:20 -0700 (PDT) X-Received: by 10.220.237.208 with SMTP id kp16mr11898216vcb.4.1379078000345; Fri, 13 Sep 2013 06:13:20 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id j1si3118244vci.26.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:13:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so878081vcb.38 for ; Fri, 13 Sep 2013 06:13:20 -0700 (PDT) X-Received: by 10.58.133.66 with SMTP id pa2mr11836571veb.18.1379078000243; Fri, 13 Sep 2013 06:13:20 -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 u4csp79952vcz; Fri, 13 Sep 2013 06:13:19 -0700 (PDT) X-Received: by 10.68.181.132 with SMTP id dw4mr2027119pbc.179.1379077999358; Fri, 13 Sep 2013 06:13:19 -0700 (PDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id bi5si11160422pab.249.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:13:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id lb1so2522808pab.12 for ; Fri, 13 Sep 2013 06:13:19 -0700 (PDT) X-Received: by 10.68.228.73 with SMTP id sg9mr13643348pbc.136.1379077998951; Fri, 13 Sep 2013 06:13:18 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id sz3sm11714505pbc.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:13:18 -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 , spear-devel@list.st.com Subject: [PATCH 087/228] cpufreq: spear: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:33 +0530 Message-Id: <443bcfbf8c55779c45a3f4a9a1c05d7a7a0296bf.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.179 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: spear-devel@list.st.com Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index b86be6b..e9657e3 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -30,11 +30,6 @@ static struct { u32 cnt; } spear_cpufreq; -static int spear_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, spear_cpufreq.freq_tbl); -} - static unsigned int spear_cpufreq_get(unsigned int cpu) { return clk_get_rate(spear_cpufreq.clk) / 1000; @@ -192,26 +187,15 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int spear_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *spear_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, - .verify = spear_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, - .exit = spear_cpufreq_exit, - .attr = spear_cpufreq_attr, + .exit = cpufreq_generic_exit, + .attr = cpufreq_generic_attr, }; static int spear_cpufreq_driver_init(void)