diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-07-04 17:12:18 -0400 |
---|---|---|
committer | Michael Turquette <mturquette@baylibre.com> | 2016-07-06 18:20:34 -0400 |
commit | 439a36d7d9318c2709066d853720bd77f201033a (patch) | |
tree | 12f807d62c00df6d17b8ed611f68e7d03e158c3b | |
parent | 80c6397c37d56f4cf8e175a541b1ebbf5f7d186a (diff) |
clk: sunxi: make clk-* explicitly non-modular
We have the following file --> Kconfig mapping:
sunxi/clk-factors.c obj-y
sunxi/clk-sun6i-apb0-gates.c CONFIG_MFD_SUN6I_PRCM (bool)
sunxi/clk-sun6i-apb0.c CONFIG_MFD_SUN6I_PRCM
sunxi/clk-sun6i-ar100.c CONFIG_MFD_SUN6I_PRCM
sunxi/clk-sun8i-apb0.c CONFIG_MFD_SUN6I_PRCM
sunxi/clk-sun9i-mmc.c obj-y
Hence none of these are being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the drivers there is no doubt they are builtin-only. All
drivers get mostly the same changes, so they are handled in batch.
Changes are (1) convert to builtin_platform_register, (2) use the
init.h header, (3) delete the MODULE_LICENCE/MODULE_AUTHOR and
associated tags, and (4) delete any ".remove" functions.
There was a stray module.h in a file not using any init.h or
module.h stuff, so we simply removed that one.
In two cases, we explicitly disallow a driver unbind, since that
doesn't have a sensible use case anyway, and it allows us to drop
the ".remove" code for non-modular drivers.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
We delete the MODULE_LICENSE etc. tags since all that information
is already contained at the top of each file in the comments.
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/20160704211220.5685-9-paul.gortmaker@windriver.com
-rw-r--r-- | drivers/clk/sunxi/clk-factors.c | 1 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 9 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sun6i-apb0.c | 9 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sun6i-ar100.c | 21 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sun8i-apb0.c | 9 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sun9i-mmc.c | 28 |
6 files changed, 12 insertions, 65 deletions
diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c index ddefe9668863..dfe5e3e32d28 100644 --- a/drivers/clk/sunxi/clk-factors.c +++ b/drivers/clk/sunxi/clk-factors.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/module.h> | ||
16 | #include <linux/of_address.h> | 15 | #include <linux/of_address.h> |
17 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
18 | #include <linux/string.h> | 17 | #include <linux/string.h> |
diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c index 68021fa5ecd9..09cdb9874636 100644 --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/clk-provider.h> | 11 | #include <linux/clk-provider.h> |
12 | #include <linux/module.h> | 12 | #include <linux/init.h> |
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | #include <linux/of_device.h> | 14 | #include <linux/of_device.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
@@ -33,7 +33,6 @@ static const struct of_device_id sun6i_a31_apb0_gates_clk_dt_ids[] = { | |||
33 | { .compatible = "allwinner,sun8i-a23-apb0-gates-clk", .data = &sun8i_a23_apb0_gates }, | 33 | { .compatible = "allwinner,sun8i-a23-apb0-gates-clk", .data = &sun8i_a23_apb0_gates }, |
34 | { /* sentinel */ } | 34 | { /* sentinel */ } |
35 | }; | 35 | }; |
36 | MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_gates_clk_dt_ids); | ||
37 | 36 | ||
38 | static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) | 37 | static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) |
39 | { | 38 | { |
@@ -102,8 +101,4 @@ static struct platform_driver sun6i_a31_apb0_gates_clk_driver = { | |||
102 | }, | 101 | }, |
103 | .probe = sun6i_a31_apb0_gates_clk_probe, | 102 | .probe = sun6i_a31_apb0_gates_clk_probe, |
104 | }; | 103 | }; |
105 | module_platform_driver(sun6i_a31_apb0_gates_clk_driver); | 104 | builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver); |
106 | |||
107 | MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>"); | ||
108 | MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver"); | ||
109 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/clk/sunxi/clk-sun6i-apb0.c b/drivers/clk/sunxi/clk-sun6i-apb0.c index e703e1895b76..b9c8d359288c 100644 --- a/drivers/clk/sunxi/clk-sun6i-apb0.c +++ b/drivers/clk/sunxi/clk-sun6i-apb0.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/clk-provider.h> | 11 | #include <linux/clk-provider.h> |
12 | #include <linux/module.h> | 12 | #include <linux/init.h> |
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | 15 | ||
@@ -61,7 +61,6 @@ static const struct of_device_id sun6i_a31_apb0_clk_dt_ids[] = { | |||
61 | { .compatible = "allwinner,sun6i-a31-apb0-clk" }, | 61 | { .compatible = "allwinner,sun6i-a31-apb0-clk" }, |
62 | { /* sentinel */ } | 62 | { /* sentinel */ } |
63 | }; | 63 | }; |
64 | MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_clk_dt_ids); | ||
65 | 64 | ||
66 | static struct platform_driver sun6i_a31_apb0_clk_driver = { | 65 | static struct platform_driver sun6i_a31_apb0_clk_driver = { |
67 | .driver = { | 66 | .driver = { |
@@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver = { | |||
70 | }, | 69 | }, |
71 | .probe = sun6i_a31_apb0_clk_probe, | 70 | .probe = sun6i_a31_apb0_clk_probe, |
72 | }; | 71 | }; |
73 | module_platform_driver(sun6i_a31_apb0_clk_driver); | 72 | builtin_platform_driver(sun6i_a31_apb0_clk_driver); |
74 | |||
75 | MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>"); | ||
76 | MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver"); | ||
77 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/clk/sunxi/clk-sun6i-ar100.c b/drivers/clk/sunxi/clk-sun6i-ar100.c index 84a187e55360..64ca3e9e38e6 100644 --- a/drivers/clk/sunxi/clk-sun6i-ar100.c +++ b/drivers/clk/sunxi/clk-sun6i-ar100.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/bitops.h> | 11 | #include <linux/bitops.h> |
12 | #include <linux/clk-provider.h> | 12 | #include <linux/clk-provider.h> |
13 | #include <linux/module.h> | 13 | #include <linux/init.h> |
14 | #include <linux/of.h> | 14 | #include <linux/of.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
@@ -91,32 +91,17 @@ static int sun6i_a31_ar100_clk_probe(struct platform_device *pdev) | |||
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | static int sun6i_a31_ar100_clk_remove(struct platform_device *pdev) | ||
95 | { | ||
96 | struct device_node *np = pdev->dev.of_node; | ||
97 | struct clk *clk = platform_get_drvdata(pdev); | ||
98 | |||
99 | sunxi_factors_unregister(np, clk); | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static const struct of_device_id sun6i_a31_ar100_clk_dt_ids[] = { | 94 | static const struct of_device_id sun6i_a31_ar100_clk_dt_ids[] = { |
105 | { .compatible = "allwinner,sun6i-a31-ar100-clk" }, | 95 | { .compatible = "allwinner,sun6i-a31-ar100-clk" }, |
106 | { /* sentinel */ } | 96 | { /* sentinel */ } |
107 | }; | 97 | }; |
108 | MODULE_DEVICE_TABLE(of, sun6i_a31_ar100_clk_dt_ids); | ||
109 | 98 | ||
110 | static struct platform_driver sun6i_a31_ar100_clk_driver = { | 99 | static struct platform_driver sun6i_a31_ar100_clk_driver = { |
111 | .driver = { | 100 | .driver = { |
112 | .name = "sun6i-a31-ar100-clk", | 101 | .name = "sun6i-a31-ar100-clk", |
113 | .of_match_table = sun6i_a31_ar100_clk_dt_ids, | 102 | .of_match_table = sun6i_a31_ar100_clk_dt_ids, |
103 | .suppress_bind_attrs = true, | ||
114 | }, | 104 | }, |
115 | .probe = sun6i_a31_ar100_clk_probe, | 105 | .probe = sun6i_a31_ar100_clk_probe, |
116 | .remove = sun6i_a31_ar100_clk_remove, | ||
117 | }; | 106 | }; |
118 | module_platform_driver(sun6i_a31_ar100_clk_driver); | 107 | builtin_platform_driver(sun6i_a31_ar100_clk_driver); |
119 | |||
120 | MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>"); | ||
121 | MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver"); | ||
122 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/clk/sunxi/clk-sun8i-apb0.c b/drivers/clk/sunxi/clk-sun8i-apb0.c index 2ea61debffc1..a5666e1d0ce7 100644 --- a/drivers/clk/sunxi/clk-sun8i-apb0.c +++ b/drivers/clk/sunxi/clk-sun8i-apb0.c | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/clk-provider.h> | 17 | #include <linux/clk-provider.h> |
18 | #include <linux/module.h> | 18 | #include <linux/init.h> |
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | #include <linux/of_address.h> | 20 | #include <linux/of_address.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
@@ -108,7 +108,6 @@ static const struct of_device_id sun8i_a23_apb0_clk_dt_ids[] = { | |||
108 | { .compatible = "allwinner,sun8i-a23-apb0-clk" }, | 108 | { .compatible = "allwinner,sun8i-a23-apb0-clk" }, |
109 | { /* sentinel */ } | 109 | { /* sentinel */ } |
110 | }; | 110 | }; |
111 | MODULE_DEVICE_TABLE(of, sun8i_a23_apb0_clk_dt_ids); | ||
112 | 111 | ||
113 | static struct platform_driver sun8i_a23_apb0_clk_driver = { | 112 | static struct platform_driver sun8i_a23_apb0_clk_driver = { |
114 | .driver = { | 113 | .driver = { |
@@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driver = { | |||
117 | }, | 116 | }, |
118 | .probe = sun8i_a23_apb0_clk_probe, | 117 | .probe = sun8i_a23_apb0_clk_probe, |
119 | }; | 118 | }; |
120 | module_platform_driver(sun8i_a23_apb0_clk_driver); | 119 | builtin_platform_driver(sun8i_a23_apb0_clk_driver); |
121 | |||
122 | MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); | ||
123 | MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver"); | ||
124 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c index 716737388b7d..6041bdba2e97 100644 --- a/drivers/clk/sunxi/clk-sun9i-mmc.c +++ b/drivers/clk/sunxi/clk-sun9i-mmc.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/clk-provider.h> | 18 | #include <linux/clk-provider.h> |
19 | #include <linux/module.h> | 19 | #include <linux/init.h> |
20 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
22 | #include <linux/reset.h> | 22 | #include <linux/reset.h> |
@@ -183,39 +183,17 @@ err_clk_register: | |||
183 | return ret; | 183 | return ret; |
184 | } | 184 | } |
185 | 185 | ||
186 | static int sun9i_a80_mmc_config_clk_remove(struct platform_device *pdev) | ||
187 | { | ||
188 | struct device_node *np = pdev->dev.of_node; | ||
189 | struct sun9i_mmc_clk_data *data = platform_get_drvdata(pdev); | ||
190 | struct clk_onecell_data *clk_data = &data->clk_data; | ||
191 | int i; | ||
192 | |||
193 | reset_controller_unregister(&data->rcdev); | ||
194 | of_clk_del_provider(np); | ||
195 | for (i = 0; i < clk_data->clk_num; i++) | ||
196 | clk_unregister(clk_data->clks[i]); | ||
197 | |||
198 | reset_control_assert(data->reset); | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static const struct of_device_id sun9i_a80_mmc_config_clk_dt_ids[] = { | 186 | static const struct of_device_id sun9i_a80_mmc_config_clk_dt_ids[] = { |
204 | { .compatible = "allwinner,sun9i-a80-mmc-config-clk" }, | 187 | { .compatible = "allwinner,sun9i-a80-mmc-config-clk" }, |
205 | { /* sentinel */ } | 188 | { /* sentinel */ } |
206 | }; | 189 | }; |
207 | MODULE_DEVICE_TABLE(of, sun9i_a80_mmc_config_clk_dt_ids); | ||
208 | 190 | ||
209 | static struct platform_driver sun9i_a80_mmc_config_clk_driver = { | 191 | static struct platform_driver sun9i_a80_mmc_config_clk_driver = { |
210 | .driver = { | 192 | .driver = { |
211 | .name = "sun9i-a80-mmc-config-clk", | 193 | .name = "sun9i-a80-mmc-config-clk", |
194 | .suppress_bind_attrs = true, | ||
212 | .of_match_table = sun9i_a80_mmc_config_clk_dt_ids, | 195 | .of_match_table = sun9i_a80_mmc_config_clk_dt_ids, |
213 | }, | 196 | }, |
214 | .probe = sun9i_a80_mmc_config_clk_probe, | 197 | .probe = sun9i_a80_mmc_config_clk_probe, |
215 | .remove = sun9i_a80_mmc_config_clk_remove, | ||
216 | }; | 198 | }; |
217 | module_platform_driver(sun9i_a80_mmc_config_clk_driver); | 199 | builtin_platform_driver(sun9i_a80_mmc_config_clk_driver); |
218 | |||
219 | MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); | ||
220 | MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver"); | ||
221 | MODULE_LICENSE("GPL v2"); | ||