From patchwork Sat Aug 10 06:44:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18970 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 706EA246EB for ; Sat, 10 Aug 2013 06:52:19 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 6sf3148671qeb.9 for ; Fri, 09 Aug 2013 23:52:19 -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=hzBK3KEtY1xjT6sk/SCL8r10V1PB6Lm/Tp8JdwM8NzI=; b=CxqNyrMDTq87CLGMHWEZQQZzm9gvdaVUd3P95dvFhqa+ZRR3ZyUVTP/mPhm9Nfioc4 CdKUKZCOVgcbxKX3P0dq5VTuDJbi3Mjwb512ZuevFWfCgoSX4zaFXOs/dHfStDRFGmAj JpqycKVo4dzpzh7lV/VOv6Ef9N71X1WN8zSBhJrihs5sTqM4PqjGaC7nznzQDuH3twmE xDQnlwjIuEN1dNtMVG0uBlU5Fs3mBZQn6t4XgBFr2E18gZOAiXXOPyoBS3T/YWSDQSox sfL4Kdh9f9SUN1UqMfaFquUZXBQTPywHQjq7FYDZuR8Up/ftI2Yawk2k1IIMpqT714rz Ax/A== X-Received: by 10.236.126.244 with SMTP id b80mr6945520yhi.31.1376117539218; Fri, 09 Aug 2013 23:52:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.9 with SMTP id kq9ls1748046qeb.48.gmail; Fri, 09 Aug 2013 23:52:19 -0700 (PDT) X-Received: by 10.220.182.69 with SMTP id cb5mr2189695vcb.41.1376117539085; Fri, 09 Aug 2013 23:52:19 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id s15si5686039vcn.29.2013.08.09.23.52.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 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.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so4472023veb.30 for ; Fri, 09 Aug 2013 23:52:19 -0700 (PDT) X-Gm-Message-State: ALoCoQklcRWzuLMokd37bXnB/0+SyHlXgnsQ1pttG8HGtXUzP6ASR5uvWnOInePOiXR6hcM6xCbI X-Received: by 10.58.211.227 with SMTP id nf3mr2219676vec.20.1376117539015; Fri, 09 Aug 2013 23:52:19 -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 u4csp248vcz; Fri, 9 Aug 2013 23:52:18 -0700 (PDT) X-Received: by 10.68.217.137 with SMTP id oy9mr14891746pbc.130.1376117537301; Fri, 09 Aug 2013 23:52:17 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id dz4si14673051pbc.29.2013.08.09.23.52.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so5649666pab.39 for ; Fri, 09 Aug 2013 23:52:16 -0700 (PDT) X-Received: by 10.68.171.196 with SMTP id aw4mr1900982pbc.193.1376117536892; Fri, 09 Aug 2013 23:52:16 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id y6sm24168297pbl.23.2013.08.09.23.52.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:16 -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 37/44] cpufreq: sc520: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:33 +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.171 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/sc520_freq.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index bb9c0de..8556225 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -78,11 +78,6 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int sc520_freq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); -} - static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -120,27 +115,14 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) } -static int sc520_freq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - - -static struct freq_attr *sc520_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - - static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, - .verify = sc520_freq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = sc520_freq_target, .init = sc520_freq_cpu_init, - .exit = sc520_freq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "sc520_freq", - .attr = sc520_freq_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id sc520_ids[] = {