From patchwork Thu Aug 29 13:16:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 2851341 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 50313BF546 for ; Thu, 29 Aug 2013 13:19:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1190C201C0 for ; Thu, 29 Aug 2013 13:19:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A569201CB for ; Thu, 29 Aug 2013 13:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754843Ab3H2NSr (ORCPT ); Thu, 29 Aug 2013 09:18:47 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:50725 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754772Ab3H2NSp (ORCPT ); Thu, 29 Aug 2013 09:18:45 -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 r7TDI6Hh029153; Thu, 29 Aug 2013 08:18:06 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7TDI6aV029826; Thu, 29 Aug 2013 08:18:06 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Thu, 29 Aug 2013 08:18:06 -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 r7TDGkKQ002988; Thu, 29 Aug 2013 08:18:04 -0500 From: Tero Kristo To: , , , , , CC: , Subject: [PATCHv6 33/45] ARM: OMAP2+: hwmod: fix opt_clk handling with DT Date: Thu, 29 Aug 2013 16:16:25 +0300 Message-ID: <1377782197-10611-34-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 Rajendra's patch had a bug which caused opt clocks to fail initialize completely, causing boot warnings with devices that depend on them. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/omap_hwmod.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 116219e..f24246c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -827,8 +827,7 @@ static const char **_parse_opt_clks_dt(struct omap_hwmod *oh, of_property_read_string_index(np, "clock-names", i, &clk_name); if (!strcmp(clk_name, "fck")) continue; - opt_clks_cnt++; - opt_clk_names[i] = clk_name; + opt_clk_names[(*opt_clks_cnt)++] = clk_name; } return opt_clk_names; } @@ -851,7 +850,7 @@ static int _init_opt_clks_dt(struct omap_hwmod *oh, struct device_node *np) oh->opt_clks_cnt = opt_clks_cnt; - for (i = 0; i < oh->opt_clks_cnt; i++) { + for (i = 0; i < opt_clks_cnt; i++) { c = of_clk_get_by_name(np, opt_clk_names[i]); if (IS_ERR(c)) { pr_warn("omap_hwmod: %s: cannot clk_get opt_clk %s\n",