From patchwork Mon Dec 10 15:25:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 1858871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6B0813FCA5 for ; Mon, 10 Dec 2012 15:30:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ti5G5-00007X-UM; Mon, 10 Dec 2012 15:27:06 +0000 Received: from eu1sys200aog119.obsmtp.com ([207.126.144.147]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Ti5FP-0008RH-SI for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 15:26:26 +0000 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUMX/EwGBNeWVfWCi2ZRUPMwO3JCQgw67@postini.com; Mon, 10 Dec 2012 15:26:23 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5B31411D; Mon, 10 Dec 2012 15:17:52 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5658BA65; Mon, 10 Dec 2012 15:26:04 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id B3CE7A8065; Mon, 10 Dec 2012 16:25:57 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 10 Dec 2012 16:26:03 +0100 From: Ulf Hansson To: "Rafael J. Wysocki" , , , Mike Turquette , Mike Turquette Subject: [RESEND PATCH 3/5] cpufreq: dbx500: Move clk_get to probe Date: Mon, 10 Dec 2012 16:25:40 +0100 Message-ID: <1355153142-9534-4-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1355153142-9534-1-git-send-email-ulf.hansson@stericsson.com> References: <1355153142-9534-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121210_102624_219111_C2EAC373 X-CRM114-Status: GOOD ( 15.47 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.147 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Philippe Begnic , Ulf Hansson , Vincent Guittot , Jonas Aberg , Linus Walleij , Rickard Andersson , Lee Jones , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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); }