From patchwork Tue Jul 19 09:21:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 72279 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp570054qga; Tue, 19 Jul 2016 02:20:33 -0700 (PDT) X-Received: by 10.98.98.193 with SMTP id w184mr53491287pfb.162.1468920032213; Tue, 19 Jul 2016 02:20:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x76si8510825pfd.200.2016.07.19.02.20.31; Tue, 19 Jul 2016 02:20:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbcGSJUX (ORCPT + 29 others); Tue, 19 Jul 2016 05:20:23 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:51150 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbcGSJUO (ORCPT ); Tue, 19 Jul 2016 05:20:14 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u6J9JqMe000550; Tue, 19 Jul 2016 18:19:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u6J9JqMe000550 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1468919994; bh=PGGzKS5WHrIgWNFZgkcD7u42+2xR2qRaAG0QdwvW5Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vaOL+q8HSph7tE7wqV+/86A+k1nTdPyBQYFor1FRy2ekYG3dSx4S4W6wCQo1ZOLqg u4qaS2LjIMbxvib3HeloJQwtUZAW6bDQVgwvsLbeUeaqMADT5xc7+okbhmtCWxBnqr 2Kt6a4JUZ8OwMDsOUhbLpbntYY1aN2WCxcwpL/R3E7t0vSBBJgZkDpt5sg2ksXIvsr AnuguXGn1NhEuZDHnblQH99rIAs0dXFfyB2Nfzi2jbaKmYy+WyAxnDVby2V7nK61eo AcjcN27hTyGGo5TeNkUIB77LhOu1f9YqMdOAn7oFbw29VDKY8qfqtSxGWnM+8reQKR kQntJ6lIdi1mg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Masahiro Yamada , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] clk: add a helper function __of_clk_find_provider() Date: Tue, 19 Jul 2016 18:21:34 +0900 Message-Id: <1468920098-8553-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468920098-8553-1-git-send-email-yamada.masahiro@socionext.com> References: <1468920098-8553-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This helper is useful to find an OF clock provider registered for a device node. Signed-off-by: Masahiro Yamada --- drivers/clk/clk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 1.9.1 diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 484acc2..e8c79a7 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3010,6 +3010,21 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data) EXPORT_SYMBOL_GPL(of_clk_hw_onecell_get); /** + * __of_clk_find_provider - Find a clock provider associated with a device node + * @np: device node to obtain the clock provider for + */ +static struct of_clk_provider *__of_clk_find_provider(struct device_node *np) +{ + struct of_clk_provider *cp; + + list_for_each_entry(cp, &of_clk_providers, link) + if (cp->node == np) + return cp; + + return NULL; +} + +/** * of_clk_add_provider() - Register a clock provider for a node * @np: Device node pointer associated with clock provider * @clk_src_get: callback for decoding clock