From patchwork Sat Aug 10 06:44:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E2EA246EB for ; Sat, 10 Aug 2013 06:50:41 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf2832180vbg.10 for ; Fri, 09 Aug 2013 23:50:41 -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=YVtq5VvJ0o/2NVbFbHsQhdfzGGNTpw56lZP2uuUz2pY=; b=HCmqjmdZaG3OOYYMNtJOl2LL6SHOz1wRPlcskhNml+vCmocueWAIz+3Lue1jT4PJ7p Sze/36f4pZw48i7B+DLmH8uuVyJBEkD64TxIGz/R4A/YASkH057MmzbfDPx6JpmiTrhm vIaTG6jYZdSb8VrOuulA8ujuVqu/luO3y6fw31kunk1aKjF2nEFlwHHK83Do5RW798rE t/I+07Lxgv9rk33f93sWFAzLwrLl1gdv9FAXyf9/x3+ZjL0Ly1w68LSYzxLxRoL6ttyt t06b09nfgCHcUVrdO0gV2vJqdfNrSmasXu2IbU3gsVmZ40ahOdb6lCzbeQ833CWIENki cGuQ== X-Received: by 10.236.147.50 with SMTP id s38mr6660314yhj.44.1376117441147; Fri, 09 Aug 2013 23:50:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.197 with SMTP id ec5ls1711374qeb.26.gmail; Fri, 09 Aug 2013 23:50:41 -0700 (PDT) X-Received: by 10.58.243.2 with SMTP id wu2mr2278688vec.74.1376117441023; Fri, 09 Aug 2013 23:50:41 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id u7si5684309vcn.37.2013.08.09.23.50.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so1603512vcb.25 for ; Fri, 09 Aug 2013 23:50:40 -0700 (PDT) X-Gm-Message-State: ALoCoQlnP/o9w95ifNBG7XiyV4utaRaT7Kff7QLCfw4yFitsi2xTeuXKwtObnGxhZunTENuIPwaD X-Received: by 10.221.47.193 with SMTP id ut1mr2236669vcb.8.1376117440941; Fri, 09 Aug 2013 23:50:40 -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 u4csp176vcz; Fri, 9 Aug 2013 23:50:40 -0700 (PDT) X-Received: by 10.66.196.168 with SMTP id in8mr4090721pac.18.1376117440049; Fri, 09 Aug 2013 23:50:40 -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 xx4si15784016pab.110.2013.08.09.23.50.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:40 -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 lb1so5744918pab.12 for ; Fri, 09 Aug 2013 23:50:39 -0700 (PDT) X-Received: by 10.66.227.39 with SMTP id rx7mr15188928pac.44.1376117439630; Fri, 09 Aug 2013 23:50:39 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id wr9sm24185763pbc.7.2013.08.09.23.50.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:39 -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 Subject: [PATCH 23/44] cpufreq: longhaul: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:19 +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.180 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/longhaul.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 70b66fd..57d7b02 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -625,12 +625,6 @@ static void longhaul_setup_voltagescaling(void) } -static int longhaul_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, longhaul_table); -} - - static int longhaul_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { @@ -924,25 +918,14 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) return cpufreq_table_validate_and_show(policy, longhaul_table); } -static int longhaul_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *longhaul_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver longhaul_driver = { - .verify = longhaul_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = longhaul_target, .get = longhaul_get, .init = longhaul_cpu_init, - .exit = longhaul_cpu_exit, + .exit = cpufreq_generic_exit, .name = "longhaul", - .attr = longhaul_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id longhaul_id[] = {