From patchwork Sat Aug 10 06:44:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18954 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8AC33246EB for ; Sat, 10 Aug 2013 06:50:27 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf6101483qec.4 for ; Fri, 09 Aug 2013 23:50:27 -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=JozJ/BKwd5fGmGTKUMoqoY7W4ENvDYLcVIhf0lL8hck=; b=HwUaeiXNEFsU8C2CNKvIt+nnQIijgWmt00F0QRzD7tb1f1jbPs7vRXIny0a3uXVgnX 9G/4CeOklpcYY3Gem3f+Bt4gAVLd9kbmaxdZ+KEFWahW1kQBHAthS6TFmZ9co7s/B3y2 u0Rajt2HC70fM+O58w/rH+52jbD+VRBe64celudapT96GynYGwOpJ2bUDigU6bZW4D9L DGY9cY7San+ibsuJXd9NUuIW4S0LlNhGlN5qE3A2MW7sZO5L8tG4TrV8hnP+FA39UGr8 Ah8ItOl64cGSDp9zyZcRKMj8o/2uZFtalQ0tJ6P03KFCG83iSRywkRnYpsWAKRr3WlW6 ZAZQ== X-Received: by 10.236.54.8 with SMTP id h8mr6803158yhc.11.1376117427338; Fri, 09 Aug 2013 23:50:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.134.74 with SMTP id pi10ls1338063qeb.35.gmail; Fri, 09 Aug 2013 23:50:27 -0700 (PDT) X-Received: by 10.58.145.97 with SMTP id st1mr7670109veb.71.1376117427226; Fri, 09 Aug 2013 23:50:27 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id h4si2141821vdw.6.2013.08.09.23.50.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so1615159vcb.2 for ; Fri, 09 Aug 2013 23:50:27 -0700 (PDT) X-Gm-Message-State: ALoCoQnFpdKZRo1Ryo04MkZvaj52sV01UYYCm3GLfEDWZfhueTI/P3cQ4mritTmDSCJRhPEJhe2a X-Received: by 10.58.154.34 with SMTP id vl2mr7732565veb.35.1376117427146; Fri, 09 Aug 2013 23:50:27 -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 u4csp170vcz; Fri, 9 Aug 2013 23:50:26 -0700 (PDT) X-Received: by 10.68.137.201 with SMTP id qk9mr14794038pbb.199.1376117426196; Fri, 09 Aug 2013 23:50:26 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id vs3si15787375pab.85.2013.08.09.23.50.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Received: by mail-pb0-f51.google.com with SMTP id jt11so5179912pbb.38 for ; Fri, 09 Aug 2013 23:50:25 -0700 (PDT) X-Received: by 10.66.189.98 with SMTP id gh2mr4263137pac.60.1376117425831; Fri, 09 Aug 2013 23:50:25 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id fa5sm24191743pbb.3.2013.08.09.23.50.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:25 -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 21/44] cpufreq: imx6q: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:17 +0530 Message-Id: <6d7504823a31aea1e4773998f60720494fb0e6b6.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.220.171 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/imx6q-cpufreq.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index e6f40fa..81d1727 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -34,11 +34,6 @@ static struct device *cpu_dev; static struct cpufreq_frequency_table *freq_table; static unsigned int transition_latency; -static int imx6q_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, freq_table); -} - static unsigned int imx6q_get_speed(unsigned int cpu) { return clk_get_rate(arm_clk) / 1000; @@ -190,25 +185,14 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int imx6q_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *imx6q_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver imx6q_cpufreq_driver = { - .verify = imx6q_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = imx6q_set_target, .get = imx6q_get_speed, .init = imx6q_cpufreq_init, - .exit = imx6q_cpufreq_exit, + .exit = cpufreq_generic_exit, .name = "imx6q-cpufreq", - .attr = imx6q_cpufreq_attr, + .attr = cpufreq_generic_attr, }; static int imx6q_cpufreq_probe(struct platform_device *pdev)