From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cl1Wa-0007ax-9s for barebox@lists.infradead.org; Mon, 06 Mar 2017 22:54:43 +0000 Received: by mail-pg0-x241.google.com with SMTP id 77so8239724pgc.0 for ; Mon, 06 Mar 2017 14:54:23 -0800 (PST) From: Andrey Smirnov Date: Mon, 6 Mar 2017 14:53:23 -0800 Message-Id: <20170306225356.31475-13-andrew.smirnov@gmail.com> In-Reply-To: <20170306225356.31475-1-andrew.smirnov@gmail.com> References: <20170306225356.31475-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 12/45] clk: No-op CLK_OF_DECLARE if not enabled To: barebox@lists.infradead.org Cc: Andrey Smirnov Instead of wrapping each defenition of CLK_OF_DECLARE hook with preprocessor guards, change the definition of CLK_OF_DECLARE to expand into no-op if COMMON_CLK_OF_PROVIDER is not enabled. Signed-off-by: Andrey Smirnov --- drivers/clk/clk-fixed-factor.c | 2 -- drivers/clk/clk-fixed.c | 3 +-- include/linux/clk.h | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index a3dbf33..0be4855 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -93,7 +93,6 @@ struct clk *clk_fixed_factor(const char *name, return &f->clk; } -#if defined(CONFIG_COMMON_CLK_OF_PROVIDER) /** * of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock */ @@ -127,4 +126,3 @@ static int of_fixed_factor_clk_setup(struct device_node *node) } CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock", of_fixed_factor_clk_setup); -#endif diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c index f0f7fba..9fa9a93 100644 --- a/drivers/clk/clk-fixed.c +++ b/drivers/clk/clk-fixed.c @@ -55,7 +55,6 @@ struct clk *clk_fixed(const char *name, int rate) return &fix->clk; } -#if defined(CONFIG_COMMON_CLK_OF_PROVIDER) /** * of_fixed_clk_setup() - Setup function for simple fixed rate clock */ @@ -76,4 +75,4 @@ static int of_fixed_clk_setup(struct device_node *node) return of_clk_add_provider(node, of_clk_src_simple_get, clk); } CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup); -#endif + diff --git a/include/linux/clk.h b/include/linux/clk.h index a061398..f705532 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -324,12 +324,13 @@ struct clk *clk_register_composite(const char *name, struct device_node; struct of_phandle_args; +#if defined(CONFIG_COMMON_CLK_OF_PROVIDER) + #define CLK_OF_DECLARE(name, compat, fn) \ const struct of_device_id __clk_of_table_##name \ __attribute__ ((unused,section (".__clk_of_table"))) \ = { .compatible = compat, .data = fn } -#if defined(CONFIG_COMMON_CLK_OF_PROVIDER) int of_clk_add_provider(struct device_node *np, struct clk *(*clk_src_get)(struct of_phandle_args *args, void *data), @@ -354,6 +355,9 @@ int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size); int of_clk_init(struct device_node *root, const struct of_device_id *matches); #else + +#define CLK_OF_DECLARE(name, compat, fn) + static inline struct clk *of_clk_get(struct device_node *np, int index) { return ERR_PTR(-ENOENT); -- 2.9.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox