From patchwork Fri Sep 13 13:00:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20134 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D64F20358 for ; Fri, 13 Sep 2013 13:12:31 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf1196271vbh.1 for ; Fri, 13 Sep 2013 06:12:31 -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=WZAaeMz0Wdw4b9okwPQqCmMSIfPa0LSwvAZY7MmVCjA=; b=kVYjbtlPdDMTfor/CihlNrIKxY/sPVjDsNcx7fBsl/x1Nam+r+q6Ce8+WW1ADJvH+a X9dfajrOnt9mgFjU2Z1h0+8t7RyuDXb+XPlIWe/fkmKeF+RRTEyJVqToKXCfj+50VNMP v9bKn1xPxQJqHJ7E0GE2Gy4MF9MIjR+uUO1N9LiOXGz5KCPjr2lRnm3DxhWAUs1+ZQba dIPp+lptbGdyUMCsJlrozIMvto6nQsGhw36DxHSdIM76SLnRzJXe0cQSGlv6t+3L23Jf +0tdGOpuQ3khCa4iBdtDbcWqFvQd27na3ToFdzPwVMoEbsT0nGzGxkuAmsevGX87y19+ c5wA== X-Gm-Message-State: ALoCoQm2Qhn0Pgn/S+jbWPdJ+HxuuR8YlYkBTQyN1u4Et1K8x0G1GkvQLnBgb5092pn3ShWsYC2s X-Received: by 10.236.116.135 with SMTP id g7mr654126yhh.53.1379077951064; Fri, 13 Sep 2013 06:12:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.30.35 with SMTP id p3ls1131173qeh.97.gmail; Fri, 13 Sep 2013 06:12:30 -0700 (PDT) X-Received: by 10.52.119.139 with SMTP id ku11mr27792vdb.42.1379077950870; Fri, 13 Sep 2013 06:12:30 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id ci9si3114743vcb.31.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jy13so929514veb.33 for ; Fri, 13 Sep 2013 06:12:30 -0700 (PDT) X-Received: by 10.58.75.131 with SMTP id c3mr8505141vew.12.1379077950788; Fri, 13 Sep 2013 06:12:30 -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 u4csp79921vcz; Fri, 13 Sep 2013 06:12:30 -0700 (PDT) X-Received: by 10.68.25.170 with SMTP id d10mr13596853pbg.78.1379077949830; Fri, 13 Sep 2013 06:12:29 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id br4si7448377pbd.63.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id xa7so1216767pbc.31 for ; Fri, 13 Sep 2013 06:12:29 -0700 (PDT) X-Received: by 10.66.88.3 with SMTP id bc3mr15092256pab.48.1379077949434; Fri, 13 Sep 2013 06:12:29 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id py4sm11701507pbc.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:28 -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 , Eric Miao Subject: [PATCH 080/228] cpufreq: pxa: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:26 +0530 Message-Id: <261b7d392095f4498f12a51c3ab64a43e7aa8493.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.128.174 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: Eric Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/pxa2xx-cpufreq.c | 26 ++------------------------ drivers/cpufreq/pxa3xx-cpufreq.c | 14 ++------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 9e8a6b4..82905fe 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -262,23 +262,6 @@ static u32 mdrefr_dri(unsigned int freq) return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; } -/* find a valid frequency point */ -static int pxa_verify_policy(struct cpufreq_policy *policy) -{ - struct cpufreq_frequency_table *pxa_freqs_table; - pxa_freqs_t *pxa_freqs; - int ret; - - find_freq_tables(&pxa_freqs_table, &pxa_freqs); - ret = cpufreq_frequency_table_verify(policy, pxa_freqs_table); - - if (freq_debug) - pr_debug("Verified CPU policy: %dKhz min to %dKhz max\n", - policy->min, policy->max); - - return ret; -} - static unsigned int pxa_cpufreq_get(unsigned int cpu) { return get_clk_frequency_khz(0); @@ -465,16 +448,11 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int pxa_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver pxa_cpufreq_driver = { - .verify = pxa_verify_policy, + .verify = cpufreq_generic_frequency_table_verify, .target = pxa_set_target, .init = pxa_cpufreq_init, - .exit = pxa_cpufreq_exit, + .exit = cpufreq_generic_exit, .get = pxa_cpufreq_get, .name = "PXA2xx", }; diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 085a27d..ae3ac08 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -150,11 +150,6 @@ static void __update_bus_freq(struct pxa3xx_freq_info *info) cpu_relax(); } -static int pxa3xx_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, pxa3xx_freqs_table); -} - static unsigned int pxa3xx_cpufreq_get(unsigned int cpu) { return pxa3xx_get_clk_frequency_khz(0); @@ -229,16 +224,11 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int pxa3xx_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver pxa3xx_cpufreq_driver = { - .verify = pxa3xx_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = pxa3xx_cpufreq_set, .init = pxa3xx_cpufreq_init, - .exit = pxa3xx_cpufreq_exit, + .exit = cpufreq_generic_exit, .get = pxa3xx_cpufreq_get, .name = "pxa3xx-cpufreq", };