Skip to contentSkip to conversation

Unexport __clk_of_table

PATCH New Stephen Boyd 1 participant 3 messages Jun 26, 2019 Common clk

lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/2 clk: Remove ifdef for COMMON_CLK in clk-provider.h

In reply to Stephen Boyd

This ifdef has been there since the beginning of this file, but it doesn't really seem to serve any purpose besides obfuscating the struct definitions and #defines here from compilation units that include it. Let's always expose these function prototypes and struct definitions so that code can inspect clk providers without needing to have CONFIG_COMMON_CLK enabled.

---
 include/linux/clk-provider.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/clk-provider.h +0 -3
index bb6118f79784..3bced2ec9f26 100644
@@ -9,8 +9,6 @@
 #include <linux/of.h>
 #include <linux/of_clk.h>
 
-#ifdef CONFIG_COMMON_CLK
-
 /*
  * flags used across common struct clk.  these flags should only affect the
  * top-level framework.  custom flags for dealing with hardware specifics
@@ -1019,5 +1017,4 @@ static inline int of_clk_detect_critical(struct device_node *np, int index,
 
 void clk_gate_restore_context(struct clk_hw *hw);
 
-#endif /* CONFIG_COMMON_CLK */
 #endif /* CLK_PROVIDER_H */
Signature · 1 line
Sent by a computer through tubes
author maintainer
#2 lore raw

PATCH 2/2 clk: Unexport __clk_of_table

In reply to Stephen Boyd

This symbol doesn't need to be exported to clk providers anymore. Originally, it was hidden inside clk.c, but then OMAP needed to get access to it in commit 819b4861c18d ("CLK: ti: add init support for clock IP blocks"), but eventually that code also changed in commit c08ee14cc663 ("clk: ti: change clock init to use generic of_clk_init") and we were left with this exported. Move this back into clk.c so that it isn't exposed anymore.

---
 drivers/clk/clk.c            | 1 +
 include/linux/clk-provider.h | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/clk/clk.c +1 -0
index aa51756fd4d6..b34e84bb8167 100644
@@ -4038,6 +4038,7 @@ struct of_clk_provider {
 	void *data;
 };
 
+extern struct of_device_id __clk_of_table;
 static const struct of_device_id __clk_of_table_sentinel
 	__used __section(__clk_of_table_end);
 
include/linux/clk-provider.h +0 -4
index 3bced2ec9f26..9ba000e3a50d 100644
@@ -865,8 +865,6 @@ static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate,
  */
 unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate);
 
-struct of_device_id;
-
 struct clk_onecell_data {
 	struct clk **clks;
 	unsigned int clk_num;
@@ -877,8 +875,6 @@ struct clk_hw_onecell_data {
 	struct clk_hw *hws[];
 };
 
-extern struct of_device_id __clk_of_table;
-
 #define CLK_OF_DECLARE(name, compat, fn) OF_DECLARE_1(clk, name, compat, fn)
 
 /*
Signature · 1 line
Sent by a computer through tubes

Stephen Boyd

author maintainer
#0 lore raw

cover Unexport __clk_of_table

I found this lying around, not sure if I sent it or not.

We don't need to export this symbol anymore. And having COMMON_CLK in clk-provider.h seems to be an artifact. Here's a couple patches to clean this stuff up.

Stephen Boyd (2):
clk: Remove ifdef for COMMON_CLK in clk-provider.h
clk: Unexport __clk_of_table

 drivers/clk/clk.c            | 1 +
 include/linux/clk-provider.h | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
Sent by a computer through tubes