From patchwork Thu Aug 29 13:16:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 2851350 Return-Path: X-Original-To: patchwork-linux-omap@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 E28E5BF547 for ; Thu, 29 Aug 2013 13:19:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 499EC2030D for ; Thu, 29 Aug 2013 13:19:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F730201C8 for ; Thu, 29 Aug 2013 13:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754948Ab3H2NS7 (ORCPT ); Thu, 29 Aug 2013 09:18:59 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:50744 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754925Ab3H2NS6 (ORCPT ); Thu, 29 Aug 2013 09:18:58 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7TDIMNc029210; Thu, 29 Aug 2013 08:18:22 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7TDIMIB030159; Thu, 29 Aug 2013 08:18:22 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Thu, 29 Aug 2013 08:18:21 -0500 Received: from sokoban.tieu.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7TDGkKX002988; Thu, 29 Aug 2013 08:18:20 -0500 From: Tero Kristo To: , , , , , CC: , Subject: [PATCHv6 40/45] ARM: OMAP2+: omap_device: use dt aware clk_get to lookup clk Date: Thu, 29 Aug 2013 16:16:32 +0300 Message-ID: <1377782197-10611-41-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1377782197-10611-1-git-send-email-t-kristo@ti.com> References: <1377782197-10611-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-9.4 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: Nishanth Menon clk_get does a check to find nodes on DT prior to trying clk_get_sys. To make omap_device dt clock node aware, use clk_get instead of clk_get_sys. As part of this, add warnings for device node entries which do not declare their own clock nodes for the expected aliases. Signed-off-by: Nishanth Menon Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/omap_device.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 7c796e2..9946900 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -48,19 +48,25 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, int ret; struct clk *r; struct device *dev = &od->pdev->dev; + struct device_node *node = dev->of_node; if (!clk_alias || !clk_name) return; dev_dbg(dev, "Creating %s -> %s\n", clk_alias, clk_name); - r = clk_get_sys(dev_name(dev), clk_alias); + r = clk_get(dev, clk_alias); if (!IS_ERR(r)) { - dev_warn(dev, "alias %s already exists\n", clk_alias); + if (!node) + dev_warn(dev, "alias '%s' already exists\n", clk_alias); clk_put(r); return; } + if (node) + dev_err(dev, "FIXME: clock-name '%s' DOES NOT exist in dt!\n", + clk_alias); + ret = clk_add_alias(clk_alias, dev_name(dev), (char *)clk_name, dev); if (ret) dev_err(dev, "Failed to alias %s to %s: %d\n", clk_alias,