From patchwork Fri Sep 13 13:00:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20119 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DAF0320358 for ; Fri, 13 Sep 2013 13:10:45 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf1232880yhz.11 for ; Fri, 13 Sep 2013 06:10:45 -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=zX67IR8c8f1EvXLKW/0rj22+vFoiiqQQkzzNlYMgM7E=; b=lpODabTIwLO0rL2MxL4JJjtgR27RASfvoauV9HnQkF3Cssp6TvG7Dtt2/bLRkYnHyK Jtq/+lLp9SmwLQKLYMh5hxdFK0A9k1go6YY/wxHiCmXGbRxFwSnPKYg+ednRRuk0SvLt H1VKF6l8HnD7GkvCLpTa3G7n1yXAKsVLUxRhxjhgAbKS4hMkHiO8ZpXFTndq1n0EKaO7 eWjwe639GLqBtMjy2YyTsTE90cMUE6o+HIIUJhsq5GrG8f1oTxaQ5l6dFvdqTfxbzaS9 L53Wrs8plst61ls5AazGlAEK4Te98c3B+xskjTAs4D3P7lONnxFKJgsHbeD9BSOVcxZl H+xA== X-Gm-Message-State: ALoCoQnQjiCeoHyEc3C/QBf6TIqL/xsCIfrkzDKDR1ritCUG1XjW/5v4VM/Ru5ZALs4tECAClT4w X-Received: by 10.236.109.134 with SMTP id s6mr4974887yhg.32.1379077845669; Fri, 13 Sep 2013 06:10:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.9 with SMTP id do9ls1168238qeb.80.gmail; Fri, 13 Sep 2013 06:10:45 -0700 (PDT) X-Received: by 10.58.46.229 with SMTP id y5mr4509099vem.15.1379077845461; Fri, 13 Sep 2013 06:10:45 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id t10si3112506vcr.35.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 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.51; Received: by mail-vb0-f51.google.com with SMTP id x16so871304vbf.24 for ; Fri, 13 Sep 2013 06:10:45 -0700 (PDT) X-Received: by 10.52.166.200 with SMTP id zi8mr200782vdb.38.1379077845383; Fri, 13 Sep 2013 06:10:45 -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 u4csp79835vcz; Fri, 13 Sep 2013 06:10:44 -0700 (PDT) X-Received: by 10.67.1.203 with SMTP id bi11mr15422662pad.137.1379077844392; Fri, 13 Sep 2013 06:10:44 -0700 (PDT) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id iv2si11198057pac.119.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id z10so1229011pdj.31 for ; Fri, 13 Sep 2013 06:10:43 -0700 (PDT) X-Received: by 10.66.118.204 with SMTP id ko12mr1613147pab.184.1379077843903; Fri, 13 Sep 2013 06:10:43 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id bb1sm11694403pbc.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:43 -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 065/228] cpufreq: elanfreq: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:11 +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.51 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/elanfreq.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c index 4000c34..fe7053c 100644 --- a/drivers/cpufreq/elanfreq.c +++ b/drivers/cpufreq/elanfreq.c @@ -165,19 +165,6 @@ static void elanfreq_set_cpu_state(struct cpufreq_policy *policy, }; -/** - * elanfreq_validatespeed: test if frequency range is valid - * @policy: the policy to validate - * - * This function checks if a given frequency range in kHz is valid - * for the hardware supported by the driver. - */ - -static int elanfreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &elanfreq_table[0]); -} - static int elanfreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -226,13 +213,6 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) } -static int elanfreq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - - #ifndef MODULE /** * elanfreq_setup - elanfreq command line parameter parsing @@ -255,20 +235,14 @@ __setup("elanfreq=", elanfreq_setup); #endif -static struct freq_attr *elanfreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - - static struct cpufreq_driver elanfreq_driver = { .get = elanfreq_get_cpu_frequency, - .verify = elanfreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = elanfreq_target, .init = elanfreq_cpu_init, - .exit = elanfreq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "elanfreq", - .attr = elanfreq_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id elan_id[] = {