From patchwork Wed Dec 18 01:17:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 3367061 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 445E5C0D4A for ; Wed, 18 Dec 2013 01:17:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81B62203AF for ; Wed, 18 Dec 2013 01:17:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B07CD203B0 for ; Wed, 18 Dec 2013 01:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806Ab3LRBRl (ORCPT ); Tue, 17 Dec 2013 20:17:41 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34317 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751293Ab3LRBRl (ORCPT ); Tue, 17 Dec 2013 20:17:41 -0500 Received: by mail-pa0-f49.google.com with SMTP id kx10so5219374pab.36 for ; Tue, 17 Dec 2013 17:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0cHwjM2+r4+UN3aQx/mnumW4FLwJAat10yWmnFaVzhc=; b=AS0YXMo+S58voi3EOhFqpQMhr0jpUPKPUtmScX0VyUKHYoUwZqbb89sOmZPMPzmv0t 3V6p7Jf85ztUFVH2Tj+Yef7YAv76t18W58qb/8f5ziFuJnvd9MBtMZHVbFeLEsQ40zWy 3xpZjm6BgG0diP7cKEuGQ5FH1xRMOXjUYYYxRAJIHA1q4pKC9gWfVJxwAtGdgj5eOW4d tIq2Fuks39lPNsHoqxG70bJQ95eaPhP+2FhEgWuG9zD/W3I/1Mv03kcqQe0lMvizCVRi b/YMZG6p8B4fy2shjEVJ/p7spUUqtzszlR0j8EMen5HjcQzJ8T5YbB/b9YSbvV0CNDbn Jrtg== X-Received: by 10.68.143.132 with SMTP id se4mr14240120pbb.167.1387329460751; Tue, 17 Dec 2013 17:17:40 -0800 (PST) Received: from localhost.localdomain (morse-p.static.monkeybrains.net. [208.90.214.40]) by mx.google.com with ESMTPSA id rz6sm50095689pab.22.2013.12.17.17.17.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 17:17:40 -0800 (PST) From: John Tobias To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, shawn.guo@linaro.org, festevam@gmail.com, cjb@laptop.org Cc: John Tobias Subject: [PATCH 3/4] Removing imx6q_opp_init Date: Tue, 17 Dec 2013 17:17:30 -0800 Message-Id: <1387329451-17480-3-git-send-email-john.tobias.ph@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387329451-17480-1-git-send-email-john.tobias.ph@gmail.com> References: <1387329451-17480-1-git-send-email-john.tobias.ph@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since of_init_opp_table is in imx6q-cpufreq.c, the imx6q_opp_init is no longer needed anymore. The only question right now is the imx6q_opp_check_1p2ghz function. Is the function below are acceptible under imx6q_init_late?. if (!cpu_dev) imx6q_opp_check_1p2ghz(cpu_dev); If not, what is the better way to impelement because the said function is board specific?. Signed-off-by: John Tobias --- arch/arm/mach-imx/mach-imx6q.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index d0cfb22..f5d9e04 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -183,31 +183,6 @@ put_node: of_node_put(np); } -static void __init imx6q_opp_init(void) -{ - struct device_node *np; - struct device *cpu_dev = get_cpu_device(0); - - if (!cpu_dev) { - pr_warn("failed to get cpu0 device\n"); - return; - } - np = of_node_get(cpu_dev->of_node); - if (!np) { - pr_warn("failed to find cpu0 node\n"); - return; - } - - if (of_init_opp_table(cpu_dev)) { - pr_warn("failed to init OPP table\n"); - goto put_node; - } - - imx6q_opp_check_1p2ghz(cpu_dev); - -put_node: - of_node_put(np); -} static struct platform_device imx6q_cpufreq_pdev = { .name = "imx6q-cpufreq", @@ -215,6 +190,7 @@ static struct platform_device imx6q_cpufreq_pdev = { static void __init imx6q_init_late(void) { + struct device *cpu_dev = get_cpu_device(0); /* * WAIT mode is broken on TO 1.0 and 1.1, so there is no point * to run cpuidle on them. @@ -223,8 +199,10 @@ static void __init imx6q_init_late(void) imx6q_cpuidle_init(); if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { - imx6q_opp_init(); platform_device_register(&imx6q_cpufreq_pdev); + + if (!cpu_dev) + imx6q_opp_check_1p2ghz(cpu_dev); } }