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: 1858821 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 71556DFB79 for ; Mon, 10 Dec 2012 15:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052Ab2LJP0Y (ORCPT ); Mon, 10 Dec 2012 10:26:24 -0500 Received: from eu1sys200aog119.obsmtp.com ([207.126.144.147]:35409 "EHLO eu1sys200aog119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753893Ab2LJP0Y (ORCPT ); Mon, 10 Dec 2012 10:26:24 -0500 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 Cc: , Lee Jones , Linus Walleij , Rickard Andersson , Jonas Aberg , Vincent Guittot , Philippe Begnic , Ulf Hansson 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 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); }