From patchwork Sat Aug 10 06:44:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 406D5246EB for ; Sat, 10 Aug 2013 06:52:41 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf5889031vbh.9 for ; Fri, 09 Aug 2013 23:52:40 -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=iiSxYkIu0A31u/t9aUTxH3UWp60zeLtm18SZz/sDhWo=; b=WGm6Pudl6pWYUX4ljhhsAF7bpR0dP+xasoQ+rBi+pWPOhqdNPl3n9mf/8VroqFiyAc qVY9qrl6grxOiq2wEYI7/wAlX7+O2rTHLBf2uYZ5jHLd4gECCPa4qEaZLVAHyvi614Jn nYqQpjPkV0CSGPSyH3QE8VSj4gQYBEfiS/KInBjBhCTFoawZrrNmKBfHJMZ4INOFXDrf 0vW0Ihdh6JfIRFzLPvUsaFvzLJM4mW2mX7mTgXaDr/aZkAFY76qyZHgm9dijmtobajJA 3Qyu3A7qKG6H2TEGcfjH8Y9znv2PmYocKwFjySoFllvZCUnV6EzQ49wBhyw6MLV/5Stn HeuA== X-Received: by 10.224.173.4 with SMTP id n4mr13384786qaz.3.1376117560887; Fri, 09 Aug 2013 23:52:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.231 with SMTP id y7ls1613877qeu.39.gmail; Fri, 09 Aug 2013 23:52:40 -0700 (PDT) X-Received: by 10.52.164.227 with SMTP id yt3mr6419888vdb.107.1376117560792; Fri, 09 Aug 2013 23:52:40 -0700 (PDT) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id r1si5676177vco.138.2013.08.09.23.52.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.54 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.54; Received: by mail-vb0-f54.google.com with SMTP id q14so3732381vbe.13 for ; Fri, 09 Aug 2013 23:52:40 -0700 (PDT) X-Gm-Message-State: ALoCoQlKfqtD4JH8Cd7cNx6sPvmbJUjgWClg5Moa0MPYs8TfZbc8fuAILacAxVTyrkZOHQ25+CPv X-Received: by 10.220.198.133 with SMTP id eo5mr2183923vcb.24.1376117560713; Fri, 09 Aug 2013 23:52: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 u4csp259vcz; Fri, 9 Aug 2013 23:52:40 -0700 (PDT) X-Received: by 10.68.218.161 with SMTP id ph1mr15003229pbc.152.1376117559711; Fri, 09 Aug 2013 23:52:39 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id dw1si14630448pbc.216.2013.08.09.23.52.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id fb10so5744350pad.9 for ; Fri, 09 Aug 2013 23:52:39 -0700 (PDT) X-Received: by 10.68.1.9 with SMTP id 9mr14798942pbi.128.1376117559351; Fri, 09 Aug 2013 23:52:39 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xl3sm24177672pbb.17.2013.08.09.23.52.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:52:38 -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 , spear-devel@list.st.com Subject: [PATCH 40/44] cpufreq: spear: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:36 +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.54 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: spear-devel@list.st.com Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 1d619dd..d31accc 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -30,11 +30,6 @@ static struct { u32 cnt; } spear_cpufreq; -static int spear_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, spear_cpufreq.freq_tbl); -} - static unsigned int spear_cpufreq_get(unsigned int cpu) { return clk_get_rate(spear_cpufreq.clk) / 1000; @@ -192,26 +187,15 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int spear_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *spear_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, - .verify = spear_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, - .exit = spear_cpufreq_exit, - .attr = spear_cpufreq_attr, + .exit = cpufreq_generic_exit, + .attr = cpufreq_generic_attr, }; static int spear_cpufreq_driver_init(void)