From patchwork Sat Aug 10 06:44:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18965 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B2966246EB for ; Sat, 10 Aug 2013 06:51:43 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id a11sf6012576qcx.9 for ; Fri, 09 Aug 2013 23:51:43 -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=wB/XKsXNNHLFPl0mNGOL7VCRnZXeFkRZSJ8GuFhftA4=; b=IKvIiVlczLQ+10w0SrjsLoXDfn4PKDFrM0fMb6h/12IfBpAGBLO3x4UyRoM+NvyP25 bGTRvxxzBjVSe2R1vQ5oZoHYSCtL4dUBK80X8P5DoZ5di2I/SmVMdBz/CHV/Bp25P14s oDYfGfHb+v7UGhGhRHozNSD9iPja/cXYep1LBUuU8i6duD/qcq2f8tDVzurrDXG8yqej bwqHpkRGBqmwYZKuCVQuxuES69Ym8r3rXJ3EtCICQurCxP8gaduhmaM59nKKfLPg5UVv NwTcjoNXadviBC0kDvFdkdbG6dxlp9kDrGSasroiJ8A8iQB6ttbwzCf/s5zYzZllNWVT wbvQ== X-Received: by 10.236.113.77 with SMTP id z53mr6929372yhg.47.1376117503453; Fri, 09 Aug 2013 23:51:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.226 with SMTP id x2ls1660594qen.12.gmail; Fri, 09 Aug 2013 23:51:43 -0700 (PDT) X-Received: by 10.52.92.16 with SMTP id ci16mr1813607vdb.88.1376117503350; Fri, 09 Aug 2013 23:51:43 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id gq10si5685427vdc.17.2013.08.09.23.51.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 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.46; Received: by mail-vb0-f46.google.com with SMTP id p13so4650852vbe.33 for ; Fri, 09 Aug 2013 23:51:43 -0700 (PDT) X-Gm-Message-State: ALoCoQm0lJOL+rIkjI9utqYAZwePIXzdJ0BD5GPpa3KBbfgtiEJ9DF9kvd50qwI2l5GWcz27CEKp X-Received: by 10.58.128.71 with SMTP id nm7mr7681914veb.51.1376117503264; Fri, 09 Aug 2013 23:51:43 -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 u4csp217vcz; Fri, 9 Aug 2013 23:51:42 -0700 (PDT) X-Received: by 10.67.4.197 with SMTP id cg5mr14887409pad.10.1376117502381; Fri, 09 Aug 2013 23:51:42 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id ci8si15750270pad.303.2013.08.09.23.51.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id q10so1390627pdj.6 for ; Fri, 09 Aug 2013 23:51:42 -0700 (PDT) X-Received: by 10.66.179.143 with SMTP id dg15mr4141014pac.52.1376117502013; Fri, 09 Aug 2013 23:51:42 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ue9sm26673209pab.7.2013.08.09.23.51.38 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:41 -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 32/44] cpufreq: ppc-corenet: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:28 +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.46 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/ppc-corenet-cpufreq.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index 5716b44..befd489 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -252,14 +252,6 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy) return 0; } -static int corenet_cpufreq_verify(struct cpufreq_policy *policy) -{ - struct cpufreq_frequency_table *table = - per_cpu(cpu_data, policy->cpu)->table; - - return cpufreq_frequency_table_verify(policy, table); -} - static int corenet_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { @@ -292,20 +284,15 @@ static int corenet_cpufreq_target(struct cpufreq_policy *policy, return ret; } -static struct freq_attr *corenet_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver ppc_corenet_cpufreq_driver = { .name = "ppc_cpufreq", .flags = CPUFREQ_CONST_LOOPS, .init = corenet_cpufreq_cpu_init, .exit = __exit_p(corenet_cpufreq_cpu_exit), - .verify = corenet_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = corenet_cpufreq_target, .get = corenet_cpufreq_get_speed, - .attr = corenet_cpufreq_attr, + .attr = cpufreq_generic_attr, }; static const struct of_device_id node_matches[] __initdata = {