From patchwork Fri Sep 13 13:00:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20114 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4909420358 for ; Fri, 13 Sep 2013 13:10:09 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q5sf1150269yen.4 for ; Fri, 13 Sep 2013 06:10:09 -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=4+Vzdj+/I6nenwlnF747ZEI3qf3Objh3A2xHjcbZRIw=; b=nJcVz8kR4N7dD/ONhE7X7t7Jke992DTiz9qACWiFvuqOn3mpFaYx4DAb+bZvf40M0K 6izseORAZT4naE19VtyHqEKGs9AQ+mul1Mor5zkjQ02wZMFm7d61iVYPp4NAxPEouW51 pflGmF2GlyBDRXNFvKBc87uye46oozJlWZdrUMCDWP11wmuSzQ5dfBROCqYa52s7fJdC esaHQn5UAXQq51LRTnJLVUnhOLqtopYH92dY7TqzwHDKmdlobWukqSPYw+F8nlWzvgIr hDsnlLjEb/hiH7swSrOdaI9D42duheMMXW6kXo0bzxur/CjUTnZJ3e2EMDk11QS34vLU vffA== X-Gm-Message-State: ALoCoQndsx84JOYsCDlbpcFGIVqUyuF8bYTxg79Web0kvvpwO9WBe/8+P/Yg4kynjSZmm0BHBKX8 X-Received: by 10.236.24.195 with SMTP id x43mr5005178yhx.3.1379077808977; Fri, 13 Sep 2013 06:10:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.72 with SMTP id eo8ls1116767qeb.41.gmail; Fri, 13 Sep 2013 06:10:08 -0700 (PDT) X-Received: by 10.52.34.109 with SMTP id y13mr10257854vdi.8.1379077808765; Fri, 13 Sep 2013 06:10:08 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id 10si3101586vcr.78.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so913028vcb.12 for ; Fri, 13 Sep 2013 06:10:08 -0700 (PDT) X-Received: by 10.52.166.200 with SMTP id zi8mr198743vdb.38.1379077808692; Fri, 13 Sep 2013 06:10:08 -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 u4csp79799vcz; Fri, 13 Sep 2013 06:10:08 -0700 (PDT) X-Received: by 10.66.136.227 with SMTP id qd3mr14992112pab.113.1379077807808; Fri, 13 Sep 2013 06:10:07 -0700 (PDT) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id gg2si11201765pac.101.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so1214267pbb.5 for ; Fri, 13 Sep 2013 06:10:07 -0700 (PDT) X-Received: by 10.68.255.229 with SMTP id at5mr13414350pbd.130.1379077807375; Fri, 13 Sep 2013 06:10:07 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id et3sm11652932pbc.43.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:06 -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 060/228] cpufreq: cpu0: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:06 +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.220.181 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. Acked-by: Shawn Guo Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-cpu0.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index ce4fa47..2847ae6 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -29,11 +29,6 @@ static struct clk *cpu_clk; static struct regulator *cpu_reg; static struct cpufreq_frequency_table *freq_table; -static int cpu0_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, freq_table); -} - static unsigned int cpu0_get_speed(unsigned int cpu) { return clk_get_rate(cpu_clk) / 1000; @@ -147,27 +142,15 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int cpu0_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - - return 0; -} - -static struct freq_attr *cpu0_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver cpu0_cpufreq_driver = { .flags = CPUFREQ_STICKY, - .verify = cpu0_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = cpu0_set_target, .get = cpu0_get_speed, .init = cpu0_cpufreq_init, - .exit = cpu0_cpufreq_exit, + .exit = cpufreq_generic_exit, .name = "generic_cpu0", - .attr = cpu0_cpufreq_attr, + .attr = cpufreq_generic_attr, }; static int cpu0_cpufreq_probe(struct platform_device *pdev)