From patchwork Wed Jul 17 14:06:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep KarkadaNagesha X-Patchwork-Id: 2828652 Return-Path: X-Original-To: patchwork-linux-pm@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 6C418C0AB2 for ; Wed, 17 Jul 2013 14:08:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD4E12020C for ; Wed, 17 Jul 2013 14:08:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 065722020A for ; Wed, 17 Jul 2013 14:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755513Ab3GQOIq (ORCPT ); Wed, 17 Jul 2013 10:08:46 -0400 Received: from service87.mimecast.com ([91.220.42.44]:55928 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755507Ab3GQOGq (ORCPT ); Wed, 17 Jul 2013 10:06:46 -0400 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 17 Jul 2013 15:06:43 +0100 Received: from e103737-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 17 Jul 2013 15:06:42 +0100 From: Sudeep.KarkadaNagesha@arm.com To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: Russell King , Shawn Guo , Gregory Clement , Greg Kroah-Hartman , Viresh Kumar , "Rafael J. Wysocki" , Grant Likely , Rob Herring , Lorenzo Pieralisi , Olof Johansson , Arnd Bergmann , Sudeep KarkadaNagesha , Andrew Lunn , Jason Cooper Subject: [RFC PATCH v2 11/15] cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu nodes Date: Wed, 17 Jul 2013 15:06:20 +0100 Message-Id: <1374069984-20567-12-git-send-email-Sudeep.KarkadaNagesha@arm.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374069984-20567-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> References: <1374069984-20567-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> X-OriginalArrivalTime: 17 Jul 2013 14:06:42.0493 (UTC) FILETIME=[DD31FED0:01CE82F6] X-MC-Unique: 113071715064314401 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Sudeep KarkadaNagesha Now that the cpu device registration initialises the of_node(if available) appropriately for all the cpus, parsing here is redundant. This patch removes all DT parsing and uses cpu->of_node instead. Cc: Andrew Lunn Cc: Jason Cooper Acked-by: Viresh Kumar Signed-off-by: Sudeep KarkadaNagesha --- drivers/cpufreq/kirkwood-cpufreq.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index c233ea6..18aa3eb 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -165,6 +166,7 @@ static struct cpufreq_driver kirkwood_cpufreq_driver = { static int kirkwood_cpufreq_probe(struct platform_device *pdev) { struct device_node *np; + struct device *cpu_dev; struct resource *res; int err; @@ -175,9 +177,17 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) if (IS_ERR(priv.base)) return PTR_ERR(priv.base); - np = of_find_node_by_path("/cpus/cpu@0"); - if (!np) + cpu_dev = get_cpu_device(0); + if (!cpu_dev) { + dev_err(&pdev->dev, "failed to get cpu device\n"); return -ENODEV; + } + + np = of_node_get(cpu_dev->of_node); + if (!np) { + dev_err(&pdev->dev, "failed to get cpu device node\n"); + return -ENODEV; + } priv.cpu_clk = of_clk_get_by_name(np, "cpu_clk"); if (IS_ERR(priv.cpu_clk)) {