From patchwork Wed Nov 28 10:27:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 1815041 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3098DDF26F for ; Wed, 28 Nov 2012 10:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754046Ab2K1K2e (ORCPT ); Wed, 28 Nov 2012 05:28:34 -0500 Received: from eu1sys200aog106.obsmtp.com ([207.126.144.121]:41436 "EHLO eu1sys200aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855Ab2K1K2b (ORCPT ); Wed, 28 Nov 2012 05:28:31 -0500 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob106.postini.com ([207.126.147.11]) with SMTP ID DSNKULXnR9shY5ui3K1GajoNq0ld/OBueyoZ@postini.com; Wed, 28 Nov 2012 10:28:30 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 22AC893; Wed, 28 Nov 2012 10:27:57 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C17052D3D; Wed, 28 Nov 2012 10:27:57 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 78760A8096; Wed, 28 Nov 2012 11:27:53 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 28 Nov 2012 11:27:56 +0100 From: Ulf Hansson To: "Rafael J. Wysocki" , , Cc: , Lee Jones , Linus Walleij , Rickard Andersson , Jonas Aberg , Vincent Guittot , Philippe Begnic , Ulf Hansson Subject: [PATCH 3/5] cpufreq: dbx500: Move clk_get to probe Date: Wed, 28 Nov 2012 11:27:42 +0100 Message-ID: <1354098464-6665-4-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1354098464-6665-1-git-send-email-ulf.hansson@stericsson.com> References: <1354098464-6665-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Ulf Hansson The armss clock shall only be fetched at probe thus move this here. Same thing goes for the printing of the available frequencies. Signed-off-by: Ulf Hansson Reviewed-by: Linus Walleij Reviewed-by: Jonas Aaberg --- drivers/cpufreq/dbx500-cpufreq.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 0a411b5..d974a8e 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -90,28 +90,14 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu) static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy) { - int i = 0; int res; - armss_clk = clk_get(NULL, "armss"); - if (IS_ERR(armss_clk)) { - pr_err("dbx500-cpufreq : Failed to get armss clk\n"); - return PTR_ERR(armss_clk); - } - - pr_info("dbx500-cpufreq : Available frequencies:\n"); - while (freq_table[i].frequency != CPUFREQ_TABLE_END) { - pr_info(" %d Mhz\n", freq_table[i].frequency/1000); - i++; - } - /* get policy fields based on the table */ res = cpufreq_frequency_table_cpuinfo(policy, freq_table); if (!res) cpufreq_frequency_table_get_attr(freq_table, policy->cpu); else { pr_err("dbx500-cpufreq : Failed to read policy table\n"); - clk_put(armss_clk); return res; } @@ -147,13 +133,26 @@ static struct cpufreq_driver dbx500_cpufreq_driver = { static int dbx500_cpufreq_probe(struct platform_device *pdev) { - freq_table = dev_get_platdata(&pdev->dev); + int i = 0; + freq_table = dev_get_platdata(&pdev->dev); if (!freq_table) { pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n"); return -ENODEV; } + armss_clk = clk_get(&pdev->dev, "armss"); + if (IS_ERR(armss_clk)) { + pr_err("dbx500-cpufreq : Failed to get armss clk\n"); + return PTR_ERR(armss_clk); + } + + pr_info("dbx500-cpufreq : Available frequencies:\n"); + while (freq_table[i].frequency != CPUFREQ_TABLE_END) { + pr_info(" %d Mhz\n", freq_table[i].frequency/1000); + i++; + } + return cpufreq_register_driver(&dbx500_cpufreq_driver); }