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: 9236549 X-Patchwork-Delegate: sboyd@codeaurora.org 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 1DA7360867 for ; Tue, 19 Jul 2016 09:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D95420072 for ; Tue, 19 Jul 2016 09:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02605205AF; Tue, 19 Jul 2016 09:20:21 +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 A34792624D for ; Tue, 19 Jul 2016 09:20:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753057AbcGSJUR (ORCPT ); Tue, 19 Jul 2016 05:20:17 -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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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