From patchwork Fri Sep 13 13:00:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20122 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E85EB20358 for ; Fri, 13 Sep 2013 13:11:06 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id e13sf1188454vbg.8 for ; Fri, 13 Sep 2013 06:11:06 -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=/wXQyEf/GUuC+i563Tb1rhPtv/vltiefTnHXlVYsqOs=; b=Rlo2Y5x3t9oLJWBTf6mxg++WnMPjTXLHLS4VImUPWUrIkvuqEJUp1lZ5F0bbrXjl/V Daokgv/yjwoPOv/2TOl309PyEK0FVNueNc4gSjnXggUZVZNshfCx80jlz+e2vX544CTV 9Dc3SO3buOCu1ilg7ETm4XqYNidh8xUL0i8LdsgXgf2/kE4uQ+EuoSOeG+EgJGEB8dmX mFFvww96Hg15v1OyShmD5/u2iHyqpetM6JKmSGLOMcOHBhUiSMyX7SCL7zsiENpc/BQJ g70HXD2slpkXVeW5EhhrPYyyGY+IbSzzLZrx2/hb4wlBVfm0tKhXfaPoXtMeZ9WKLPpe n+0w== X-Gm-Message-State: ALoCoQmPkunNL/Kfra1izKBZJmaAaQdu9GyBaK6Z4lyTIVdc1s0eiQS92pcOl2c9k0lhS6vr1B7r X-Received: by 10.236.94.205 with SMTP id n53mr5008024yhf.44.1379077866667; Fri, 13 Sep 2013 06:11:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.102 with SMTP id 6ls1067829qel.40.gmail; Fri, 13 Sep 2013 06:11:06 -0700 (PDT) X-Received: by 10.220.97.145 with SMTP id l17mr28122vcn.35.1379077866423; Fri, 13 Sep 2013 06:11:06 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id o5si3109245vdw.24.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id ib11so927833vcb.0 for ; Fri, 13 Sep 2013 06:11:06 -0700 (PDT) X-Received: by 10.221.44.136 with SMTP id ug8mr11933421vcb.13.1379077866316; Fri, 13 Sep 2013 06:11:06 -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 u4csp79851vcz; Fri, 13 Sep 2013 06:11:05 -0700 (PDT) X-Received: by 10.66.251.40 with SMTP id zh8mr1614898pac.185.1379077865392; Fri, 13 Sep 2013 06:11:05 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id sl4si11124371pac.329.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id fb10so2532143pad.9 for ; Fri, 13 Sep 2013 06:11:05 -0700 (PDT) X-Received: by 10.66.121.68 with SMTP id li4mr15086290pab.33.1379077864991; Fri, 13 Sep 2013 06:11:04 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id tg7sm11666298pbc.36.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:04 -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 Subject: [PATCH 068/228] cpufreq: imx6q: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:14 +0530 Message-Id: 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.169 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. Acked-by: Shawn Guo Signed-off-by: Viresh Kumar --- 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 cd9489f..29767bb 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; @@ -173,25 +168,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)