From patchwork Sat Aug 10 06:44: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: 18951 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 134A5246EB for ; Sat, 10 Aug 2013 06:50:06 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf634629qab.9 for ; Fri, 09 Aug 2013 23:50:05 -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=zX67IR8c8f1EvXLKW/0rj22+vFoiiqQQkzzNlYMgM7E=; b=UUczQ3NcRF912JvBwPWtVsLpg2scVgqF16hCZ5HvcXorjlRuMJNIodTVUyGYw3ndzA qPKhZobSSCgoKwWribDukNjoFJvD6d2/gScAo5AWGINkulYSk2MIX7JYmgNvjG5uNmfA vyDq76wqWw477LUqTBB7oSXyKKDu8olkfDbwNppMuxY2VOVWOwaOxn5t5Z+G2/+u0Bha oK/MHuphgPQURM1gMxyZHWrexm9PJDJge8FPtjrgJN+Uy5vq4j/oZPgV+i9bSpzJPKLB BwoyA1+j5S/jyLBctekJCpofhh3fpBfoFCi/Qwr3uAXP2/PnrJfAyf7VVkZK/HsLNnWK aDyQ== X-Received: by 10.236.44.140 with SMTP id n12mr6887704yhb.6.1376117405843; Fri, 09 Aug 2013 23:50:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.69 with SMTP id gk5ls592839qeb.57.gmail; Fri, 09 Aug 2013 23:50:05 -0700 (PDT) X-Received: by 10.52.73.229 with SMTP id o5mr1863558vdv.54.1376117405741; Fri, 09 Aug 2013 23:50:05 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id bk8si5685103vec.18.2013.08.09.23.50.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id b10so4540291vea.35 for ; Fri, 09 Aug 2013 23:50:05 -0700 (PDT) X-Gm-Message-State: ALoCoQlSE2uTnt7iP0fxWWl+9FoI5IG82EuDSg6z8E6asvkJ0QJFQs9FU3/oFfFy5H7LR2lfHmrd X-Received: by 10.52.164.16 with SMTP id ym16mr1850308vdb.32.1376117405668; Fri, 09 Aug 2013 23:50:05 -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 u4csp150vcz; Fri, 9 Aug 2013 23:50:05 -0700 (PDT) X-Received: by 10.66.234.232 with SMTP id uh8mr4169431pac.155.1376117404780; Fri, 09 Aug 2013 23:50:04 -0700 (PDT) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id dw1si14625139pbc.216.2013.08.09.23.50.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.42; Received: by mail-pa0-f42.google.com with SMTP id lj1so5715327pab.29 for ; Fri, 09 Aug 2013 23:50:04 -0700 (PDT) X-Received: by 10.66.163.164 with SMTP id yj4mr15179121pab.91.1376117404383; Fri, 09 Aug 2013 23:50:04 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xe9sm24159059pbc.21.2013.08.09.23.50.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:03 -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 18/44] cpufreq: elanfreq: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14: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.128.176 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[] = {