clk: consoldiate the __clk_get_hw() declarations
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 2 Jul 2019 02:03:50 +0000 (12:03 +1000)
committerStephen Boyd <sboyd@kernel.org>
Fri, 12 Jul 2019 18:00:14 +0000 (11:00 -0700)
Without this we were getting errors like:

In file included from drivers/clk/clkdev.c:22:0:
drivers/clk/clk.h:36:23: error: static declaration of '__clk_get_hw' follows non-static declaration
include/linux/clk-provider.h:808:16: note: previous declaration of '__clk_get_hw' was here

Fixes: 59fcdce425b7 ("clk: Remove ifdef for COMMON_CLK in clk-provider.h")
fixes: 73e0e496afda ("clkdev: Always allocate a struct clk and call __clk_get() w/ CCF")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.h
drivers/clk/imx/clk-imx6q.c
drivers/clk/imx/clk-imx6sll.c
drivers/clk/imx/clk-imx6sx.c
drivers/clk/imx/clk-imx6ul.c
drivers/clk/imx/clk-imx7d.c
drivers/clk/imx/clk.c
include/linux/clk-provider.h

index d8400d623b34b73bfe6bcabac2d7a00f3732a9eb..2d801900cad5981fb78e7c915dc27321fe674427 100644 (file)
@@ -33,10 +33,6 @@ clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
 {
        return (struct clk *)hw;
 }
-static struct clk_hw *__clk_get_hw(struct clk *clk)
-{
-       return (struct clk_hw *)clk;
-}
 static inline void __clk_put(struct clk *clk) { }
 
 #endif
index 708e7c5590ddc89f01f691623748a731396fc26c..fa5ef3cc2240bf8f7db80b0423885587fb034374 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/of.h>
index 7eea448cb9a98627c457a96221a26214989c5385..a9548c4b6d785e84bb8dea8d09d8a8ebc9b16853 100644 (file)
@@ -7,6 +7,7 @@
 #include <dt-bindings/clock/imx6sll-clock.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
index 91558b09bf9eb04a92b60ab4a43a37e6ce4c19fa..77748d6d4ccc94edb1c5994bec9276612efa3b7b 100644 (file)
@@ -12,6 +12,7 @@
 #include <dt-bindings/clock/imx6sx-clock.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
index fd60d1549f719076d05df587d21ca686d0ba7261..e0e4625aacd02bc464a061e5d2bbe508a6f6f7fc 100644 (file)
@@ -12,6 +12,7 @@
 #include <dt-bindings/clock/imx6ul-clock.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
index 5b8a0c729f90298ed90bf3d4360da83f56d60663..0ff3eb14d3af0d3497da408fd3640409672d415b 100644 (file)
@@ -12,6 +12,7 @@
 #include <dt-bindings/clock/imx7d-clock.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
index 1efed86217f72a6d4264d210f73a2f65a408ce00..588d1f45325d7465ae62c832b0ccf41bb4b83c63 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/of.h>
 #include <linux/slab.h>
index 9ba000e3a50d75fc386f902a6ee50088cecc326c..55d48140b0d0cde8c34999d5b2bba3ecec76d903 100644 (file)
@@ -805,7 +805,14 @@ void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw);
 /* helper functions */
 const char *__clk_get_name(const struct clk *clk);
 const char *clk_hw_get_name(const struct clk_hw *hw);
+#ifdef CONFIG_COMMON_CLK
 struct clk_hw *__clk_get_hw(struct clk *clk);
+#else
+static inline struct clk_hw *__clk_get_hw(struct clk *clk)
+{
+       return (struct clk_hw *)clk;
+}
+#endif
 unsigned int clk_hw_get_num_parents(const struct clk_hw *hw);
 struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
 struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,