Received: by 10.213.65.68 with SMTP id h4csp3862705imn; Tue, 10 Apr 2018 05:56:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/qjX7z+QafV3GIG2nWk6XfLG9jn4iU8FccIr1sb9Y8vEc3LlP4PMlaq93yWzvhPHPNpbM1 X-Received: by 2002:a17:902:b40d:: with SMTP id x13-v6mr308341plr.167.1523365001605; Tue, 10 Apr 2018 05:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523365001; cv=none; d=google.com; s=arc-20160816; b=H8Pbv4foQqYOAD2kkx9YEKJxHJ+hAU3mEUj88WnJAF0x3IEB87J4cFM5N0YZ6i5aAn Lrmy6VTygZfMKii8xIXf6xKFpzgeRX6+dsPv3wUmqwIWAXKW4uobRxisS9WYFB73Nthn LOxBpemaKGKsBzcIB6j5Ab1+KSKxfnMAUnjC9exyxrSMrn9XrDdvFv79N8ocVP9Lwsoy mormJrJIIiLu7jKZMYWgzk5WDINeK6taOGgavIRGWtNGNOH0EEpqjoU/CGrI3uo+jsLo qrh3YAYe47vW35zMmhK2rnSJm5/IiYr3sCFzAyy2zEpxE3yNs0BcHLaddrELAhTTdynr vIGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Fn3/H9IazulcZ1CA4p99Ns362lALGzKHtfdDQBuaqKw=; b=ZrpYDJOZtfvHkQSeGhMujT+k6f0NXlaCJP+brCiTCUc7x1Mpdbh147/o90COcnbuEm Mf1KS5kpEvSF7F7D3qe0pazWsdHnl0pK+/KkcWkkyqwQktD/BppPsIcZebRqnMUoSHpc BatG0vDFepPk0OP3tt/+h6U9oTjx2h43CwAGc4A5KxCu2ROeRcYkkK9qsbgkj/9Oi/Pp NpSfhFAk5sbDgum/WL5MQQnG6GqrQGrsRD1d69XI0rdv5jK4tZYZGay9t0gd/G96GU9k r2msd/LzSIYZNf/7L7bqGMsjxRwpKMLR9lIwmaMpDcMysK8YhsTvQOzBSYTUQpM70IX4 Y20Q== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si2095592pfi.317.2018.04.10.05.56.04; Tue, 10 Apr 2018 05:56:41 -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; 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 S1753127AbeDJMwk (ORCPT + 99 others); Tue, 10 Apr 2018 08:52:40 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:44202 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbeDJMwB (ORCPT ); Tue, 10 Apr 2018 08:52:01 -0400 Received: from ayla.of.borg ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id Ycrj1x00U3XaVaC01crj7N; Tue, 10 Apr 2018 14:52:00 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1f5skR-00054M-N7; Tue, 10 Apr 2018 14:51:43 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1f5skR-000410-Lx; Tue, 10 Apr 2018 14:51:43 +0200 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd Cc: Rob Herring , Frank Rowand , Daniel Lezcano , Thomas Gleixner , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Heiko Stuebner , Thierry Reding , Jonathan Hunter , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 1/5] clk: Extract OF clock helpers in Date: Tue, 10 Apr 2018 14:51:37 +0200 Message-Id: <1523364701-15383-2-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523364701-15383-1-git-send-email-geert+renesas@glider.be> References: <1523364701-15383-1-git-send-email-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The use of of_clk_get_parent_{count,name}() and of_clk_init() is not limited to clock providers. Hence move these helpers into their own header file, so callers that are not clock providers no longer have to include . Suggested-by: Stephen Boyd Signed-off-by: Geert Uytterhoeven --- v2: - New. I have't added an SPDX-License-Identifier line, as also doesn't have one yet. Other candidates to be moved here later? - of_clk_get(), - of_clk_get_by_name(), - of_clk_get_from_provider(). --- include/linux/clk-provider.h | 14 +------------- include/linux/of_clk.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 include/linux/of_clk.h diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 210a890008f9e129..61cb4729f22acd6b 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -13,6 +13,7 @@ #include #include +#include #ifdef CONFIG_COMMON_CLK @@ -890,13 +891,10 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec, struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data); -unsigned int of_clk_get_parent_count(struct device_node *np); int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size); -const char *of_clk_get_parent_name(struct device_node *np, int index); int of_clk_detect_critical(struct device_node *np, int index, unsigned long *flags); -void of_clk_init(const struct of_device_id *matches); #else /* !CONFIG_OF */ @@ -943,26 +941,16 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data) { return ERR_PTR(-ENOENT); } -static inline unsigned int of_clk_get_parent_count(struct device_node *np) -{ - return 0; -} static inline int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size) { return 0; } -static inline const char *of_clk_get_parent_name(struct device_node *np, - int index) -{ - return NULL; -} static inline int of_clk_detect_critical(struct device_node *np, int index, unsigned long *flags) { return 0; } -static inline void of_clk_init(const struct of_device_id *matches) {} #endif /* CONFIG_OF */ /* diff --git a/include/linux/of_clk.h b/include/linux/of_clk.h new file mode 100644 index 0000000000000000..ba3c0e6983ec1543 --- /dev/null +++ b/include/linux/of_clk.h @@ -0,0 +1,29 @@ +/* + * OF clock helpers + */ + +#ifndef __LINUX_OF_CLK_H +#define __LINUX_OF_CLK_H + +#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) + +unsigned int of_clk_get_parent_count(struct device_node *np); +const char *of_clk_get_parent_name(struct device_node *np, int index); +void of_clk_init(const struct of_device_id *matches); + +#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ + +static inline unsigned int of_clk_get_parent_count(struct device_node *np) +{ + return 0; +} +static inline const char *of_clk_get_parent_name(struct device_node *np, + int index) +{ + return NULL; +} +static inline void of_clk_init(const struct of_device_id *matches) {} + +#endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */ + +#endif /* __LINUX_OF_CLK_H */ -- 2.7.4