From patchwork Sat Nov 11 16:29:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10054419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F336760632 for ; Sat, 11 Nov 2017 16:29:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B67C229A16 for ; Sat, 11 Nov 2017 16:29:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA3DB29A31; Sat, 11 Nov 2017 16:29:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5225329A16 for ; Sat, 11 Nov 2017 16:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbdKKQ3e (ORCPT ); Sat, 11 Nov 2017 11:29:34 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:48017 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbdKKQ3d (ORCPT ); Sat, 11 Nov 2017 11:29:33 -0500 Received: by mail-lf0-f65.google.com with SMTP id f125so14084804lff.4; Sat, 11 Nov 2017 08:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=iBLdHu3/mXUvVlTAegUO9vB+zMA0hgc9DfGRhAZu5lQ=; b=DlYluGCL8xY459Na7YyeXe0OeAAa16WzKw0vIswfS4DlbfkHM36fSgG/8tkq8eePnS rAE6uI/+hVBfzeH0F+oxZwB1JnfLD9+N/lz3+mqvpLv6uBadUa8isfBuUulvS5c4fA4f dOT/hBd32xEOYPr2T3NskCBpRFeFeypfdiC87L2M/EaMIicq02nchPJiUlyvdSdVsoLU KOT+jeBFRvMX7lHErMgyU5a7l5ZXBXSgfZ+KDIfco764I0XJIC/lZqeJoik3nF0z0MoR NpcPKjPYglLK9j2WvbedNPDhiG4tlJCcaUkXR29wbvVOyGaSoKo7H40XdqvB+OLhzqRf fVFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=iBLdHu3/mXUvVlTAegUO9vB+zMA0hgc9DfGRhAZu5lQ=; b=jpgQzRDRYCPiFaE3xQrReUO0hU+3ApqpHZfGJaZykqp0G3huElEkDphUG7EMClrd5z C/TK2T8rUeCiHRkMQDone548cngUPLQa6l5RlujlEub2RCY8rnQWSvDaMk8QWBX7jMMD gqfrshkq37QcSUq3ei3zKQrTFwKTB98aihSjfbDLRDgQk2TRW/zdoiyGReedWk4IZsld FYIF9vGm17DCGviKv6e6+1QyNylfpbCeKxMXxWFdcdBY5HlGV7h9Z9OK1p9KzC/z3pLH VTf6fnF88XYWKhZwZ+VHQczcgmda1MDfQyvP4i6aWjKW3CEkg+MMthWP6IPJpbP1moQz ToWA== X-Gm-Message-State: AJaThX6m+tATvEzZ/G2CPjtn2vJwwQ7gGNXS84c/tAw71OhBhWBPSpSX 1Xkn+2JrQFZWieikiIATgKA= X-Google-Smtp-Source: AGs4zMasKsRf8kUs1nJol+/5imK1zQpes/b9CdSZP48M2tHZDiN+blc7wCSzGcl3gV4WZRHELDA/Xg== X-Received: by 10.46.20.91 with SMTP id 27mr1630906lju.23.1510417771137; Sat, 11 Nov 2017 08:29:31 -0800 (PST) Received: from xi.terra (c-c0bae655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.186.192]) by smtp.gmail.com with ESMTPSA id s5sm2098867lfs.55.2017.11.11.08.29.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Nov 2017 08:29:30 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1eDYf1-00033n-QG; Sat, 11 Nov 2017 17:29:35 +0100 From: Johan Hovold To: Stephen Boyd Cc: Andy Gross , David Brown , Michael Turquette , Tero Kristo , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 1/2] clk: qcom: common: fix legacy board-clock registration Date: Sat, 11 Nov 2017 17:29:28 +0100 Message-Id: <20171111162929.11722-1-johan@kernel.org> X-Mailer: git-send-email 2.15.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure to search only the child nodes of "/clocks", rather than the whole device-tree depth-first starting at "/clocks" when determining whether to register a fixed clock in the legacy board-clock registration helper. Fixes: ee15faffef11 ("clk: qcom: common: Add API to register board clocks backwards compatibly") Signed-off-by: Johan Hovold --- drivers/clk/qcom/common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index b35564c0493f..b8064a336d46 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -133,8 +133,10 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path, int ret; clocks_node = of_find_node_by_path("/clocks"); - if (clocks_node) - node = of_find_node_by_name(clocks_node, path); + if (clocks_node) { + node = of_get_child_by_name(clocks_node, path); + of_node_put(clocks_node); + } if (!node) { fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);