From patchwork Sat Aug 10 06:44:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18957 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7B9AF246EB for ; Sat, 10 Aug 2013 06:50:48 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m12sf1500847yen.1 for ; Fri, 09 Aug 2013 23:50:48 -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=GFvNHvW5JG77+lcgV5v3+LyzngihYSWmKjuGk5Ch2Qc=; b=hTbvZJtr1UKKL8uiquFo7Z00vw2YDpRfBR1FWVssALLqj9DceDynCrlkQ9Szb7+ndR GfjMkFlWZWv9DhHq00HuVTz2gtpp0SV6VdWvbShYO0TorLucjIygUDU7YPNBbvxi6IrR eADfuWpDgVNi/JT1AaKPDy9mRzliZxEoeBSEPZ8a5ujW/Zh0z9ikpvKXSOICjD0nL0zA pqTF546m9Kn8qE6hd9G1h6qHXejd8ZyqcIYzu5PVxDEDQA0BwXoP/9BeijYfBaCpljNk N+IMbTyEPbvc+qrmcVdYLRTIRexlerii2Yvz9R88HPWdm/mFhqtHUGnLJWln/ZKv3K8C BaEw== X-Received: by 10.236.74.169 with SMTP id x29mr6896349yhd.34.1376117448191; Fri, 09 Aug 2013 23:50:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.5.197 with SMTP id u5ls1809580qeu.84.gmail; Fri, 09 Aug 2013 23:50:48 -0700 (PDT) X-Received: by 10.220.84.65 with SMTP id i1mr2176460vcl.51.1376117448035; Fri, 09 Aug 2013 23:50:48 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id x7si5679626vdo.74.2013.08.09.23.50.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id e15so4590090vbg.18 for ; Fri, 09 Aug 2013 23:50:48 -0700 (PDT) X-Gm-Message-State: ALoCoQlFVzWcETEcqTgc+SfExl24SrMCuWJqCa54ENWzNFqanvy+AoL9imHGbeSvztAu9fUcCPUg X-Received: by 10.52.109.69 with SMTP id hq5mr6429613vdb.85.1376117447960; Fri, 09 Aug 2013 23:50:47 -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 u4csp181vcz; Fri, 9 Aug 2013 23:50:47 -0700 (PDT) X-Received: by 10.66.2.7 with SMTP id 7mr4210941paq.181.1376117447133; Fri, 09 Aug 2013 23:50:47 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id tp5si15775592pac.164.2013.08.09.23.50.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so5744278pad.33 for ; Fri, 09 Aug 2013 23:50:46 -0700 (PDT) X-Received: by 10.68.1.9 with SMTP id 9mr14794609pbi.128.1376117446741; Fri, 09 Aug 2013 23:50:46 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xl3sm24168541pbb.17.2013.08.09.23.50.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:46 -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 , John Crispin Subject: [PATCH 24/44] cpufreq: loongson2: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:20 +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.212.45 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: John Crispin Signed-off-by: Viresh Kumar --- drivers/cpufreq/loongson2_cpufreq.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c index cec4e72..ed7fbe2 100644 --- a/drivers/cpufreq/loongson2_cpufreq.c +++ b/drivers/cpufreq/loongson2_cpufreq.c @@ -137,12 +137,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy) &loongson2_clockmod_table[0]); } -static int loongson2_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, - &loongson2_clockmod_table[0]); -} - static int loongson2_cpufreq_exit(struct cpufreq_policy *policy) { cpufreq_frequency_table_put_attr(policy->cpu); @@ -150,19 +144,14 @@ static int loongson2_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static struct freq_attr *loongson2_table_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver loongson2_cpufreq_driver = { .name = "loongson2", .init = loongson2_cpufreq_cpu_init, - .verify = loongson2_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = loongson2_cpufreq_target, .get = loongson2_cpufreq_get, .exit = loongson2_cpufreq_exit, - .attr = loongson2_table_attr, + .attr = cpufreq_generic_attr, }; static struct platform_device_id platform_device_ids[] = {