Skip to contentSkip to conversation

clk: fix/remove module usage in non-modular code

PATCH Applied Paul Gortmaker 9 participants 30 messages Jul 4, 2016 – Nov 4, 2016

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

cover clk: fix/remove module usage in non-modular code

This series covers the audit of non-modular module code use in the drivers/clk/ directory.

Quasi generic boiler plate description follows; included for folks who haven't yet seen what we are aiming to achieve with this operation.

We are trying to not use module support for code that can never be built as a module because:

(1) it is easy to accidentally write unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead.
(4) it gets copied/replicated into other code and spreads like weeds.

With respect to #1 in this instance, we see for these 10 commits:

    15 files changed, 37 insertions(+), 227 deletions(-)

...which is a respectable (IMHO) net amount of removal of unused code.

Changes seen here cover the following categories:

-just replacement of modular macros with their non-modular
equivalents that CPP would have inserted anyway, such as:

	module_init --> device_initcall
	module_platform_driver --> builtin_platform_driver

-the removal of including module.h ; replaced with init.h
as required based on whether the file used it.

-the removal of any/all unused/orphaned __exit functions that
would never be called.

-the removal of instances of MODULE_DEVICE_TABLE and MODULE_ALIAS
that become no-ops in the non-modular case.

-the removal of any ".remove" functions that were hooked into
the driver struct. This ".remove" function would of
course not be called from the __exit function since that was never run. However in theory, someone could have triggered it via sysfs unbind, even though there isn't a sensible use case for doing so. So to cover that possibility, we've also disabled sysfs unbind in the driver.

-the removal of MODULE_DESCRIIPTION/AUTHOR/LICENSE tags that are
also no-ops for non-modular ; we ensure the information in those tags is present in the top of file comments in each case.

There are no initcall level changes here; everything stays at the level of initcall it was previously - either by not using modular versions to begin with, or by using the builtin level equivalents.

As usual, we can consider making some of these tristate if an author has strong feelings about extending support into the modular realm, but I won't be able to run-time test any of that.

I batched the sunxi changes together since they had similar author and maintainer fields and it helps avoid polluting history with too many mundane commits, but I can split that up if so desired.

Build testing done on linux-next on arm/arm64 and x86/x86_64.

Paul.
---

Cc Aleksandr Frid <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Boris BREZILLON <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Emilio L?pez" <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Padmavathi Venna <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Peter De Schrijver <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Prashant Gaikwad <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Sylwester Nawrocki <[email protected]>
Cc Tero Kristo <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc linux-amlogic at lists.infradead.org
Cc linux-clk at vger.kernel.org
Cc linux-omap at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
Cc linux-tegra at vger.kernel.org

Paul Gortmaker (10):
clk: meson8b: make it explicitly non-modular
clk: meson: make gxbb explicitly non-modular
clk: mvebu: make cp110-system-controller explicitly non-modular
clk: mvebu: make ap806-system-controller explicitly non-modular
clk: oxnas: make it explicitly non-modular
clk: samsung make clk-exynos-audss explicitly non-modular
clk: samsung: make clk-s5pv210-audss explicitly non-modular
clk: sunxi: make clk-* explicitly non-modular
clk: tegra: make clk-tegra124-dfll-fcpu explicitly non-modular
clk: ti: make clk-dra7-atl explicitly non-modular

 drivers/clk/clk-oxnas.c                     | 15 +++----------
 drivers/clk/meson/gxbb.c                    | 18 ++++-----------
 drivers/clk/meson/meson8b-clkc.c            | 19 ++++------------
 drivers/clk/mvebu/ap806-system-controller.c | 23 +++----------------
 drivers/clk/mvebu/cp110-system-controller.c | 34 +++--------------------------
 drivers/clk/samsung/clk-exynos-audss.c      | 13 +----------
 drivers/clk/samsung/clk-s5pv210-audss.c     | 29 ++----------------------
 drivers/clk/sunxi/clk-factors.c             |  1 -
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c    |  9 ++------
 drivers/clk/sunxi/clk-sun6i-apb0.c          |  9 ++------
 drivers/clk/sunxi/clk-sun6i-ar100.c         | 21 +++---------------
 drivers/clk/sunxi/clk-sun8i-apb0.c          |  9 ++------
 drivers/clk/sunxi/clk-sun9i-mmc.c           | 28 +++---------------------
 drivers/clk/tegra/clk-tegra124-dfll-fcpu.c  | 16 ++------------
 drivers/clk/ti/clk-dra7-atl.c               | 20 +++--------------
 15 files changed, 37 insertions(+), 227 deletions(-)
Signature · 1 line
2.8.4
#1 lore raw

PATCH 1/10 clk: meson8b: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/clk/meson/Kconfig:config COMMON_CLK_MESON8B
drivers/clk/meson/Kconfig: bool

...meaning that it currently is not being built as a module by anyone. However a recent commit added a bunch of modular boilerplate to this driver.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE DEVICE_TABLE/ALIAS are no-op when non-modular.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc linux-clk at vger.kernel.org
Cc linux-amlogic at lists.infradead.org
---
 drivers/clk/meson/meson8b-clkc.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/clk/meson/meson8b-clkc.c +4 -15
index b1902e91213d..4c9413cdf373 100644
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S805 / Meson8b Clock Controller Driver
+ *
  * Copyright (c) 2015 Endless Mobile, Inc.
  * Author: Carlo Caione <[email protected]>
  *
@@ -23,7 +25,7 @@
 #include <linux/of_address.h>
 #include <dt-bindings/clock/meson8b-clkc.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 
 #include "clkc.h"
 
@@ -429,7 +431,6 @@ static const struct of_device_id meson8b_clkc_match_table[] = {
 	{ .compatible = "amlogic,meson8b-clkc" },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, meson8b_match_table);
 
 static struct platform_driver meson8b_driver = {
 	.probe		= meson8b_clkc_probe,
@@ -443,16 +444,4 @@ static int __init meson8b_clkc_init(void)
 {
 	return platform_driver_register(&meson8b_driver);
 }
-module_init(meson8b_clkc_init);
-
-static void __exit meson8b_clkc_exit(void)
-{
-	platform_driver_unregister(&meson8b_driver);
-}
-module_exit(meson8b_clkc_exit);
-
-MODULE_DESCRIPTION("AmLogic S805 / Meson8b Clock Controller Driver");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:meson8b-clkc");
-MODULE_AUTHOR("Michael Turquette <[email protected]>");
-MODULE_AUTHOR("Carlo Caione <[email protected]>");
+device_initcall(meson8b_clkc_init);
Signature · 1 line
2.8.4
#2 lore raw

Re: [PATCH 01/10] clk: meson8b: make it explicitly non-modular

Quoting Paul Gortmaker (2016-07-04 14:12:11)

Quoted 20 lines

The Kconfig currently controlling compilation of this code is:

drivers/clk/meson/Kconfig:config COMMON_CLK_MESON8B
drivers/clk/meson/Kconfig: bool

...meaning that it currently is not being built as a module by anyone. However a recent commit added a bunch of modular boilerplate to this driver.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE DEVICE_TABLE/ALIAS are no-op when non-modular.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Quoted 7 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc linux-clk at vger.kernel.org
Cc linux-amlogic at lists.infradead.org

Applied.

Regards,
Mike

Quoted 53 lines
---
 drivers/clk/meson/meson8b-clkc.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/clk/meson/meson8b-clkc.c +4 -15
index b1902e91213d..4c9413cdf373 100644
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S805 / Meson8b Clock Controller Driver
+ *
  * Copyright (c) 2015 Endless Mobile, Inc.
  * Author: Carlo Caione <[email protected]>
  *
@@ -23,7 +25,7 @@
 #include <linux/of_address.h>
 #include <dt-bindings/clock/meson8b-clkc.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 
 #include "clkc.h"
 
@@ -429,7 +431,6 @@ static const struct of_device_id meson8b_clkc_match_table[] = {
        { .compatible = "amlogic,meson8b-clkc" },
        { }
 };
-MODULE_DEVICE_TABLE(of, meson8b_match_table);
 
 static struct platform_driver meson8b_driver = {
        .probe          = meson8b_clkc_probe,
@@ -443,16 +444,4 @@ static int __init meson8b_clkc_init(void)
 {
        return platform_driver_register(&meson8b_driver);
 }
-module_init(meson8b_clkc_init);
-
-static void __exit meson8b_clkc_exit(void)
-{
-       platform_driver_unregister(&meson8b_driver);
-}
-module_exit(meson8b_clkc_exit);
-
-MODULE_DESCRIPTION("AmLogic S805 / Meson8b Clock Controller Driver");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:meson8b-clkc");
-MODULE_AUTHOR("Michael Turquette <[email protected]>");
-MODULE_AUTHOR("Carlo Caione <[email protected]>");
+device_initcall(meson8b_clkc_init);
Signature · 1 line
2.8.4
#3 lore raw

PATCH 2/10 clk: meson: make gxbb explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/meson/Kconfig:config COMMON_CLK_GXBB
drivers/clk/meson/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE and ALIAS are no-op for non-modules.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc linux-clk at vger.kernel.org
Cc linux-amlogic at lists.infradead.org
---
 drivers/clk/meson/gxbb.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/clk/meson/gxbb.c +4 -14
index 007b7157cf4b..a4c6684b3019 100644
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S905 / GXBB Clock Controller Driver
+ *
  * Copyright (c) 2016 AmLogic, Inc.
  * Michael Turquette <[email protected]>
  *
@@ -19,7 +21,7 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 
 #include "clkc.h"
 #include "gxbb.h"
@@ -926,7 +928,6 @@ static const struct of_device_id gxbb_clkc_match_table[] = {
 	{ .compatible = "amlogic,gxbb-clkc" },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, gxbb_match_table);
 
 static struct platform_driver gxbb_driver = {
 	.probe		= gxbb_clkc_probe,
@@ -940,15 +941,4 @@ static int __init gxbb_clkc_init(void)
 {
 	return platform_driver_register(&gxbb_driver);
 }
-module_init(gxbb_clkc_init);
-
-static void __exit gxbb_clkc_exit(void)
-{
-	platform_driver_unregister(&gxbb_driver);
-}
-module_exit(gxbb_clkc_exit);
-
-MODULE_DESCRIPTION("AmLogic S905 / GXBB Clock Controller Driver");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:gxbb-clkc");
-MODULE_AUTHOR("Michael Turquette <[email protected]>");
+device_initcall(gxbb_clkc_init);
Signature · 1 line
2.8.4
#4 lore raw

Re: [PATCH 02/10] clk: meson: make gxbb explicitly non-modular

Quoting Paul Gortmaker (2016-07-04 14:12:12)

Quoted 18 lines

The Kconfig currently controlling compilation of this code is:

drivers/clk/meson/Kconfig:config COMMON_CLK_GXBB
drivers/clk/meson/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE and ALIAS are no-op for non-modules.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Quoted 7 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc linux-clk at vger.kernel.org
Cc linux-amlogic at lists.infradead.org

Applied.

Regards,
Mike

Quoted 52 lines
---
 drivers/clk/meson/gxbb.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/clk/meson/gxbb.c +4 -14
index 007b7157cf4b..a4c6684b3019 100644
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S905 / GXBB Clock Controller Driver
+ *
  * Copyright (c) 2016 AmLogic, Inc.
  * Michael Turquette <[email protected]>
  *
@@ -19,7 +21,7 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 
 #include "clkc.h"
 #include "gxbb.h"
@@ -926,7 +928,6 @@ static const struct of_device_id gxbb_clkc_match_table[] = {
        { .compatible = "amlogic,gxbb-clkc" },
        { }
 };
-MODULE_DEVICE_TABLE(of, gxbb_match_table);
 
 static struct platform_driver gxbb_driver = {
        .probe          = gxbb_clkc_probe,
@@ -940,15 +941,4 @@ static int __init gxbb_clkc_init(void)
 {
        return platform_driver_register(&gxbb_driver);
 }
-module_init(gxbb_clkc_init);
-
-static void __exit gxbb_clkc_exit(void)
-{
-       platform_driver_unregister(&gxbb_driver);
-}
-module_exit(gxbb_clkc_exit);
-
-MODULE_DESCRIPTION("AmLogic S905 / GXBB Clock Controller Driver");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:gxbb-clkc");
-MODULE_AUTHOR("Michael Turquette <[email protected]>");
+device_initcall(gxbb_clkc_init);
Signature · 1 line
2.8.4
#5 lore raw

PATCH 3/10 clk: mvebu: make cp110-system-controller explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/mvebu/Kconfig:config ARMADA_CP110_SYSCON
drivers/clk/mvebu/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 drivers/clk/mvebu/cp110-system-controller.c | 34 +++--------------------------
 1 file changed, 3 insertions(+), 31 deletions(-)
drivers/clk/mvebu/cp110-system-controller.c +3 -31
index 7fa42d6b2b92..15c8b76cc27f 100644
@@ -30,7 +30,7 @@
 
 #include <linux/clk-provider.h>
 #include <linux/mfd/syscon.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -362,45 +362,17 @@ fail0:
 	return ret;
 }
 
-static int cp110_syscon_clk_remove(struct platform_device *pdev)
-{
-	int i;
-
-	of_clk_del_provider(pdev->dev.of_node);
-
-	for (i = 0; i < CP110_MAX_GATABLE_CLOCKS; i++) {
-		struct clk *clk = cp110_clks[CP110_MAX_CORE_CLOCKS + i];
-
-		if (clk)
-			cp110_unregister_gate(clk);
-	}
-
-	clk_unregister_fixed_factor(cp110_clks[CP110_CORE_NAND]);
-	clk_unregister_fixed_factor(cp110_clks[CP110_CORE_CORE]);
-	clk_unregister_fixed_factor(cp110_clks[CP110_CORE_EIP]);
-	clk_unregister_fixed_factor(cp110_clks[CP110_CORE_PPV2]);
-	clk_unregister_fixed_rate(cp110_clks[CP110_CORE_APLL]);
-
-	return 0;
-}
-
 static const struct of_device_id cp110_syscon_of_match[] = {
 	{ .compatible = "marvell,cp110-system-controller0", },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, armada8k_pcie_of_match);
 
 static struct platform_driver cp110_syscon_driver = {
 	.probe = cp110_syscon_clk_probe,
-	.remove = cp110_syscon_clk_remove,
 	.driver		= {
 		.name	= "marvell-cp110-system-controller0",
 		.of_match_table = cp110_syscon_of_match,
+		.suppress_bind_attrs = true,
 	},
 };
-
-module_platform_driver(cp110_syscon_driver);
-
-MODULE_DESCRIPTION("Marvell CP110 System Controller 0 driver");
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(cp110_syscon_driver);
Signature · 1 line
2.8.4
Applied
#6 lore raw

Re: [PATCH 03/10] clk: mvebu: make cp110-system-controller explicitly non-modular

Quoted 23 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/mvebu/Kconfig:config ARMADA_CP110_SYSCON
drivers/clk/mvebu/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Quoted 6 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#7 lore raw

PATCH 4/10 clk: mvebu: make ap806-system-controller explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/mvebu/Kconfig:config ARMADA_AP806_SYSCON
drivers/clk/mvebu/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 drivers/clk/mvebu/ap806-system-controller.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)
drivers/clk/mvebu/ap806-system-controller.c +3 -20
index 02023baf86c9..8181b919f062 100644
@@ -14,7 +14,7 @@
 
 #include <linux/clk-provider.h>
 #include <linux/mfd/syscon.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -135,34 +135,17 @@ fail0:
 	return ret;
 }
 
-static int ap806_syscon_clk_remove(struct platform_device *pdev)
-{
-	of_clk_del_provider(pdev->dev.of_node);
-	clk_unregister_fixed_factor(ap806_clks[3]);
-	clk_unregister_fixed_rate(ap806_clks[2]);
-	clk_unregister_fixed_rate(ap806_clks[1]);
-	clk_unregister_fixed_rate(ap806_clks[0]);
-
-	return 0;
-}
-
 static const struct of_device_id ap806_syscon_of_match[] = {
 	{ .compatible = "marvell,ap806-system-controller", },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, armada8k_pcie_of_match);
 
 static struct platform_driver ap806_syscon_driver = {
 	.probe = ap806_syscon_clk_probe,
-	.remove = ap806_syscon_clk_remove,
 	.driver		= {
 		.name	= "marvell-ap806-system-controller",
 		.of_match_table = ap806_syscon_of_match,
+		.suppress_bind_attrs = true,
 	},
 };
-
-module_platform_driver(ap806_syscon_driver);
-
-MODULE_DESCRIPTION("Marvell AP806 System Controller driver");
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(ap806_syscon_driver);
Signature · 1 line
2.8.4
Applied
#8 lore raw

Re: [PATCH 04/10] clk: mvebu: make ap806-system-controller explicitly non-modular

Quoted 23 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/mvebu/Kconfig:config ARMADA_AP806_SYSCON
drivers/clk/mvebu/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Quoted 6 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#9 lore raw

PATCH 5/10 clk: oxnas: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/clk/Kconfig:config COMMON_CLK_OXNAS
drivers/clk/Kconfig: bool "Clock driver for the OXNAS SoC Family"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Neil Armstrong <[email protected]>
---
 drivers/clk/clk-oxnas.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/clk/clk-oxnas.c +3 -12
index 79bcb2e42060..47649ac5d399 100644
@@ -18,7 +18,7 @@
 
 #include <linux/clk-provider.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/stringify.h>
@@ -170,26 +170,17 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
 				   clk_oxnas->onecell_data);
 }
 
-static int oxnas_stdclk_remove(struct platform_device *pdev)
-{
-	of_clk_del_provider(pdev->dev.of_node);
-
-	return 0;
-}
-
 static const struct of_device_id oxnas_stdclk_dt_ids[] = {
 	{ .compatible = "oxsemi,ox810se-stdclk" },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, oxnas_stdclk_dt_ids);
 
 static struct platform_driver oxnas_stdclk_driver = {
 	.probe = oxnas_stdclk_probe,
-	.remove = oxnas_stdclk_remove,
 	.driver	= {
 		.name = "oxnas-stdclk",
+		.suppress_bind_attrs = true,
 		.of_match_table = oxnas_stdclk_dt_ids,
 	},
 };
-
-module_platform_driver(oxnas_stdclk_driver);
+builtin_platform_driver(oxnas_stdclk_driver);
Signature · 1 line
2.8.4
Acked-by on v1 5/10
#10 lore raw

Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular

2016-07-04 23:12 GMT+02:00 Paul Gortmaker <[email protected]>:

Quoted 20 lines

The Kconfig currently controlling compilation of this code is:

drivers/clk/Kconfig:config COMMON_CLK_OXNAS
drivers/clk/Kconfig: bool "Clock driver for the OXNAS SoC Family"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Quoted 9 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Neil Armstrong <[email protected]>
---
 drivers/clk/clk-oxnas.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
#11 lore raw

Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular

In reply to Paul Gortmaker

Quoting Paul Gortmaker (2016-07-04 14:12:15)

Quoted 24 lines

The Kconfig currently controlling compilation of this code is:
=

drivers/clk/Kconfig:config COMMON_CLK_OXNAS
drivers/clk/Kconfig: bool "Clock driver for the OXNAS SoC Family"
=

...meaning that it currently is not being built as a module by anyone. =

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. =

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.
=

Quoted 8 lines

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. =

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Neil Armstrong <[email protected]>

Applied.

Regards,
Mike

drivers/clk/clk-oxnas.c static int oxnas_stdclk_probe(struct platform_devic=

Quoted 20 lines
---
 drivers/clk/clk-oxnas.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

=

drivers/clk/clk-oxnas.c +1 -1
index 79bcb2e42060..47649ac5d399 100644
@@ -18,7 +18,7 @@
 =
 
 #include <linux/clk-provider.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>

#include <linux/stringify.h>

drivers/clk/clk-oxnas.c +0 -0
@@ -170,26 +170,17 @@ static int oxnas_stdclk_probe(struct platform_devic=

e *pdev)

Quoted 34 lines
drivers/clk/clk-oxnas.c +2 -12
                                   clk_oxnas->onecell_data);
 }
 =
 
-static int oxnas_stdclk_remove(struct platform_device *pdev)
-{
-       of_clk_del_provider(pdev->dev.of_node);
-
-       return 0;
-}
-
 static const struct of_device_id oxnas_stdclk_dt_ids[] =3D {
        { .compatible =3D "oxsemi,ox810se-stdclk" },
        { }
 };
-MODULE_DEVICE_TABLE(of, oxnas_stdclk_dt_ids);
 =
 
 static struct platform_driver oxnas_stdclk_driver =3D {
        .probe =3D oxnas_stdclk_probe,
-       .remove =3D oxnas_stdclk_remove,
        .driver =3D {
                .name =3D "oxnas-stdclk",
+               .suppress_bind_attrs =3D true,
                .of_match_table =3D oxnas_stdclk_dt_ids,
        },
 };
-
-module_platform_driver(oxnas_stdclk_driver);
+builtin_platform_driver(oxnas_stdclk_driver);
-- =

2.8.4
=20

#12 lore raw

PATCH 6/10 clk: samsung make clk-exynos-audss explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-exynos/Kconfig:menuconfig ARCH_EXYNOS
arch/arm/mach-exynos/Kconfig: bool "Samsung EXYNOS" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init was already not used by this code, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Padmavathi Venna <[email protected]>
---
 drivers/clk/samsung/clk-exynos-audss.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/clk/samsung/clk-exynos-audss.c +1 -12
index 4e9584d79089..42b62f865198 100644
@@ -15,7 +15,7 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 
 #include <dt-bindings/clock/exynos-audss-clk.h>
@@ -278,14 +278,3 @@ static int __init exynos_audss_clk_init(void)
 	return platform_driver_register(&exynos_audss_clk_driver);
 }
 core_initcall(exynos_audss_clk_init);
-
-static void __exit exynos_audss_clk_exit(void)
-{
-	platform_driver_unregister(&exynos_audss_clk_driver);
-}
-module_exit(exynos_audss_clk_exit);
-
-MODULE_AUTHOR("Padmavathi Venna <[email protected]>");
-MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:exynos-audss-clk");
Signature · 1 line
2.8.4
#13 lore raw

Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular

Quoted 51 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-exynos/Kconfig:menuconfig ARCH_EXYNOS
arch/arm/mach-exynos/Kconfig: bool "Samsung EXYNOS" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init was already not used by this code, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Padmavathi Venna <[email protected]>
---
 drivers/clk/samsung/clk-exynos-audss.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/clk/samsung/clk-exynos-audss.c +1 -2
index 4e9584d79089..42b62f865198 100644
@@ -15,7 +15,7 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 
 #include <dt-bindings/clock/exynos-audss-clk.h>
@@ -278,14 +278,3 @@ static int __init exynos_audss_clk_init(void)
 	return platform_driver_register(&exynos_audss_clk_driver);
 }
 core_initcall(exynos_audss_clk_init);
-

drivers/clk/samsung/clk-exynos-audss.c static int __init exynos_audss_clk_init(void) · line 291

Quoted 10 lines
drivers/clk/samsung/clk-exynos-audss.c +0 -10
-static void __exit exynos_audss_clk_exit(void)
-{
-	platform_driver_unregister(&exynos_audss_clk_driver);
-}
-module_exit(exynos_audss_clk_exit);
-
-MODULE_AUTHOR("Padmavathi Venna <[email protected]>");
-MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:exynos-audss-clk");

Why not removing .remove() callback as well?

I don't find sysfs unbind hook useful except testing the exit paths... which in that case do not exist anymore (there is no "modprobe -r" for it anyway).

Best regards,
Krzysztof

#14 lore raw

Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular

Quoted 14 lines · [Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular]…
Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-exynos/Kconfig:menuconfig ARCH_EXYNOS
arch/arm/mach-exynos/Kconfig: bool "Samsung EXYNOS" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

[...]

Quoted 9 lines

drivers/clk/samsung/clk-exynos-audss.c static int __init exynos_audss_clk_init(void) · line 291

Quoted 3 lines
drivers/clk/samsung/clk-exynos-audss.c +0 -3
-MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:exynos-audss-clk");

Why not removing .remove() callback as well?

I don't find sysfs unbind hook useful except testing the exit paths... which in that case do not exist anymore (there is no "modprobe -r" for it anyway).

Yes, I normally delete the .remove callbacks as indicated in the 0/10,
but somehow I overlooked this one. Thanks for spotting it. I'll
delete it and disable the sysfs bind in v2.

Paul.
--

Quoted 4 lines

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular

In reply to Paul Gortmaker

Hi Paul,

Quoted 2 lines · Paul Gortmaker

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

But the unstructured information at the top of the file is much more difficult to grep for...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#16 lore raw

Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular

Quoted 9 lines · [Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular]…

Hi Paul,

Quoted 2 lines · Paul Gortmaker

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

But the unstructured information at the top of the file is much more difficult to grep for...

...which IMHO is largely a moot point, since the MODULE_<xyz> tags aren't universally deployed and largely don't exist at all once you are outside of the driver space.

Paul.
--

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#17 lore raw

Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular

In reply to Paul Gortmaker
Quoted 24 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-exynos/Kconfig:menuconfig ARCH_EXYNOS
arch/arm/mach-exynos/Kconfig: bool "Samsung EXYNOS" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init was already not used by this code, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

---

#include <dt-bindings/clock/exynos-audss-clk.h>

drivers/clk/samsung/clk-exynos-audss.c static int __init exynos_audss_clk_init(void) · line 280

Quoted 3 lines
drivers/clk/samsung/clk-exynos-audss.c +0 -0
@@ -278,14 +278,3 @@ static int __init exynos_audss_clk_init(void)
 	return platform_driver_register(&exynos_audss_clk_driver);
 }
 core_initcall(exynos_audss_clk_init);

Thanks for the patch. I will try to get rid of the above initcall instead of removing module support. Any clock dependencies should now be handled properly with deferred probing. And the module support will be useful since the audss clock controller is present only on selected Exynos SoC variants.

#18 lore raw

PATCH 7/10 clk: samsung: make clk-s5pv210-audss explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-s5pv210/Kconfig:config ARCH_S5PV210 arch/arm/mach-s5pv210/Kconfig: bool "Samsung S5PV210/S5PC110" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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 this code is already not using module_init, case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
---
 drivers/clk/samsung/clk-s5pv210-audss.c | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)
drivers/clk/samsung/clk-s5pv210-audss.c +2 -27
index eefb84b22566..c66ed2d1450e 100644
@@ -18,7 +18,7 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 
 #include <dt-bindings/clock/s5pv210-audss.h>
@@ -194,20 +194,6 @@ unregister:
 	return ret;
 }
 
-static int s5pv210_audss_clk_remove(struct platform_device *pdev)
-{
-	int i;
-
-	of_clk_del_provider(pdev->dev.of_node);
-
-	for (i = 0; i < clk_data.clk_num; i++) {
-		if (!IS_ERR(clk_table[i]))
-			clk_unregister(clk_table[i]);
-	}
-
-	return 0;
-}
-
 static const struct of_device_id s5pv210_audss_clk_of_match[] = {
 	{ .compatible = "samsung,s5pv210-audss-clock", },
 	{},
@@ -216,10 +202,10 @@ static const struct of_device_id s5pv210_audss_clk_of_match[] = {
 static struct platform_driver s5pv210_audss_clk_driver = {
 	.driver	= {
 		.name = "s5pv210-audss-clk",
+		.suppress_bind_attrs = true,
 		.of_match_table = s5pv210_audss_clk_of_match,
 	},
 	.probe = s5pv210_audss_clk_probe,
-	.remove = s5pv210_audss_clk_remove,
 };
 
 static int __init s5pv210_audss_clk_init(void)
@@ -227,14 +213,3 @@ static int __init s5pv210_audss_clk_init(void)
 	return platform_driver_register(&s5pv210_audss_clk_driver);
 }
 core_initcall(s5pv210_audss_clk_init);
-
-static void __exit s5pv210_audss_clk_exit(void)
-{
-	platform_driver_unregister(&s5pv210_audss_clk_driver);
-}
-module_exit(s5pv210_audss_clk_exit);
-
-MODULE_AUTHOR("Tomasz Figa <[email protected]>");
-MODULE_DESCRIPTION("S5PV210 Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:s5pv210-audss-clk");
Signature · 1 line
2.8.4
#19 lore raw

Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular

Patch applied, thanks.

maintainer Acked-by on v1 7/10
#20 lore raw

Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular

In reply to Paul Gortmaker
Quoted 20 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-s5pv210/Kconfig:config ARCH_S5PV210 arch/arm/mach-s5pv210/Kconfig: bool "Samsung S5PV210/S5PC110" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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 this code is already not using module_init, case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Quoted 7 lines
Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>

In case this is going to be applied directly to current clk-next:

#21 lore raw

Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular

Quoting Sylwester Nawrocki (2016-07-13 03:32:42)

Quoted 6 lines · Paul Gortmaker
Quoted 5 lines

The Kconfig currently controlling compilation of this code is:
=

arch/arm/mach-s5pv210/Kconfig:config ARCH_S5PV210 arch/arm/mach-s5pv210/Kconfig: bool "Samsung S5PV210/S5PC110" if ARCH_=

MULTI_V7

Quoted 29 lines
Quoted 22 lines

=

...meaning that it currently is not being built as a module by anyone. =

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. =

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 this code is already not using module_init, case, the init ordering remains unchanged with this commit.
=

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments. =

Quoted 7 lines
Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Quoted 7 lines

=

In case this is going to be applied directly to current clk-next:
=

=

Applied to clk-next.

I know that we normally take PRs for the samsung clk stuff, but this late in the cycle I'm OK to simply pick individual patches.

Thanks,
Mike

#22 lore raw

PATCH 8/10 clk: sunxi: make clk-* explicitly non-modular

In reply to Paul Gortmaker

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.

Cc Boris BREZILLON <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Emilio López" <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/clk/sunxi/clk-factors.c          |  1 -
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-apb0.c       |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-ar100.c      | 21 +++------------------
 drivers/clk/sunxi/clk-sun8i-apb0.c       |  9 ++-------
 drivers/clk/sunxi/clk-sun9i-mmc.c        | 28 +++-------------------------
 6 files changed, 12 insertions(+), 65 deletions(-)
drivers/clk/sunxi/clk-factors.c +0 -1
index ddefe9668863..dfe5e3e32d28 100644
@@ -12,7 +12,6 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/string.h>
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +2 -7
index 68021fa5ecd9..09cdb9874636 100644
@@ -9,7 +9,7 @@
  */
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -33,7 +33,6 @@ static const struct of_device_id sun6i_a31_apb0_gates_clk_dt_ids[] = {
 	{ .compatible = "allwinner,sun8i-a23-apb0-gates-clk", .data = &sun8i_a23_apb0_gates },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_gates_clk_dt_ids);
 
 static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
 {
@@ -102,8 +101,4 @@ static struct platform_driver sun6i_a31_apb0_gates_clk_driver = {
 	},
 	.probe = sun6i_a31_apb0_gates_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_gates_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
drivers/clk/sunxi/clk-sun6i-apb0.c +2 -7
index e703e1895b76..b9c8d359288c 100644
@@ -9,7 +9,7 @@
  */
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 
@@ -61,7 +61,6 @@ static const struct of_device_id sun6i_a31_apb0_clk_dt_ids[] = {
 	{ .compatible = "allwinner,sun6i-a31-apb0-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_clk_dt_ids);
 
 static struct platform_driver sun6i_a31_apb0_clk_driver = {
 	.driver = {
@@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver = {
 	},
 	.probe = sun6i_a31_apb0_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_clk_driver);
drivers/clk/sunxi/clk-sun6i-ar100.c +3 -18
index 84a187e55360..64ca3e9e38e6 100644
@@ -10,7 +10,7 @@
 
 #include <linux/bitops.h>
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
@@ -91,32 +91,17 @@ static int sun6i_a31_ar100_clk_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int sun6i_a31_ar100_clk_remove(struct platform_device *pdev)
-{
-	struct device_node *np = pdev->dev.of_node;
-	struct clk *clk = platform_get_drvdata(pdev);
-
-	sunxi_factors_unregister(np, clk);
-
-	return 0;
-}
-
 static const struct of_device_id sun6i_a31_ar100_clk_dt_ids[] = {
 	{ .compatible = "allwinner,sun6i-a31-ar100-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_ar100_clk_dt_ids);
 
 static struct platform_driver sun6i_a31_ar100_clk_driver = {
 	.driver = {
 		.name = "sun6i-a31-ar100-clk",
 		.of_match_table = sun6i_a31_ar100_clk_dt_ids,
+		.suppress_bind_attrs = true,
 	},
 	.probe = sun6i_a31_ar100_clk_probe,
-	.remove = sun6i_a31_ar100_clk_remove,
 };
-module_platform_driver(sun6i_a31_ar100_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_ar100_clk_driver);
drivers/clk/sunxi/clk-sun8i-apb0.c +2 -7
index 2ea61debffc1..a5666e1d0ce7 100644
@@ -15,7 +15,7 @@
  */
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -108,7 +108,6 @@ static const struct of_device_id sun8i_a23_apb0_clk_dt_ids[] = {
 	{ .compatible = "allwinner,sun8i-a23-apb0-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun8i_a23_apb0_clk_dt_ids);
 
 static struct platform_driver sun8i_a23_apb0_clk_driver = {
 	.driver = {
@@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driver = {
 	},
 	.probe = sun8i_a23_apb0_clk_probe,
 };
-module_platform_driver(sun8i_a23_apb0_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun8i_a23_apb0_clk_driver);
drivers/clk/sunxi/clk-sun9i-mmc.c +3 -25
index 716737388b7d..6041bdba2e97 100644
@@ -16,7 +16,7 @@
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/reset.h>
@@ -183,39 +183,17 @@ err_clk_register:
 	return ret;
 }
 
-static int sun9i_a80_mmc_config_clk_remove(struct platform_device *pdev)
-{
-	struct device_node *np = pdev->dev.of_node;
-	struct sun9i_mmc_clk_data *data = platform_get_drvdata(pdev);
-	struct clk_onecell_data *clk_data = &data->clk_data;
-	int i;
-
-	reset_controller_unregister(&data->rcdev);
-	of_clk_del_provider(np);
-	for (i = 0; i < clk_data->clk_num; i++)
-		clk_unregister(clk_data->clks[i]);
-
-	reset_control_assert(data->reset);
-
-	return 0;
-}
-
 static const struct of_device_id sun9i_a80_mmc_config_clk_dt_ids[] = {
 	{ .compatible = "allwinner,sun9i-a80-mmc-config-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun9i_a80_mmc_config_clk_dt_ids);
 
 static struct platform_driver sun9i_a80_mmc_config_clk_driver = {
 	.driver = {
 		.name = "sun9i-a80-mmc-config-clk",
+		.suppress_bind_attrs = true,
 		.of_match_table = sun9i_a80_mmc_config_clk_dt_ids,
 	},
 	.probe = sun9i_a80_mmc_config_clk_probe,
-	.remove = sun9i_a80_mmc_config_clk_remove,
 };
-module_platform_driver(sun9i_a80_mmc_config_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun9i_a80_mmc_config_clk_driver);
Signature · 1 line
2.8.4
Acked-by on v1 8/10
#23 lore raw

Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular

Quoted 26 lines · On Mon, 4 Jul 2016 17:12:18 -0400 Paul Gortmaker…

We have the following file --> Kconfig mapping:
=20

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

=20
Hence none of these are being built as a module by anyone. =20
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. =20
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. =20
There was a stray module.h in a file not using any init.h or module.h stuff, so we simply removed that one.
=20
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.
=20

Quoted 8 lines

Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit.
=20
We delete the MODULE_LICENSE etc. tags since all that information is already contained at the top of each file in the comments. =20
Cc: Boris BREZILLON <[email protected]>

Quoted 7 lines
Cc Chen-Yu Tsai <[email protected]>
Cc "Emilio L=C3=B3pez" <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Maxime Ripard <[email protected]>
Quoted 7 lines
---
 drivers/clk/sunxi/clk-factors.c          |  1 -
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-apb0.c       |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-ar100.c      | 21 +++------------------
 drivers/clk/sunxi/clk-sun8i-apb0.c       |  9 ++-------

drivers/clk/sunxi/clk-sun9i-mmc.c | 28 +++-----------------------=

--

drivers/clk/sunxi/clk-fact=

Quoted 3 lines
 6 files changed, 12 insertions(+), 65 deletions(-)

=20

drivers/clk/sunxi/clk-fact= renamed from drivers/clk/sunxi/clk-factors.c +0 -0

ors.c

drivers/clk/sunxi=

Quoted 12 lines

index ddefe9668863..dfe5e3e32d28 100644

drivers/clk/sunxi/clk-factors.c +0 -1
@@ -12,7 +12,6 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/string.h>
drivers/clk/sunxi= renamed from drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0

/clk-sun6i-apb0-gates.c

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static const struct of_device_id sun6i_a31_apb0_gates_c=

Quoted 13 lines

index 68021fa5ecd9..09cdb9874636 100644

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
@@ -9,7 +9,7 @@
  */

=20
#include <linux/clk-provider.h>

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -1
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -33,7 +33,6 @@ static const struct of_device_id sun6i_a31_apb0_gates_c=

lk_dt_ids[] =3D {

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static const struct of_device_id sun6i_a31_apb0_gates_c= · line 33

Quoted 1 line
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
 	{ .compatible =3D "allwinner,sun8i-a23-apb0-gates-clk", .data =3D &sun8=

i_a23_apb0_gates },

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static struct platform_driver sun6i_a31_apb0_gates_cl=

Quoted 7 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -1
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_gates_clk_dt_ids);

=20
static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) {

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
@@ -102,8 +101,4 @@ static struct platform_driver sun6i_a31_apb0_gates_cl=

k_driver =3D {

drivers/clk/sunxi/clk-s=

Quoted 10 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -5
 	},
 	.probe =3D sun6i_a31_apb0_gates_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_gates_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
drivers/clk/sunxi/clk-s= renamed from drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0

un6i-apb0.c

drivers/clk/sunxi/clk-sun6i-apb0.c static const struct of_device_id sun6i_a31_apb0_clk_dt_=

Quoted 13 lines

index e703e1895b76..b9c8d359288c 100644

drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0
@@ -9,7 +9,7 @@
  */

=20
#include <linux/clk-provider.h>

drivers/clk/sunxi/clk-sun6i-apb0.c +1 -1
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>

=20

drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0
@@ -61,7 +61,6 @@ static const struct of_device_id sun6i_a31_apb0_clk_dt_=

ids[] =3D {

drivers/clk/sunxi/clk-sun6i-apb0.c static struct platform_driver sun6i_a31_apb0_clk_driver=

Quoted 8 lines
drivers/clk/sunxi/clk-sun6i-apb0.c +0 -1
 	{ .compatible =3D "allwinner,sun6i-a31-apb0-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_clk_dt_ids);

=20
static struct platform_driver sun6i_a31_apb0_clk_driver =3D {

drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0
 	.driver =3D {
@@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver=

=3D {

drivers/clk/sunxi/clk-=

Quoted 10 lines
drivers/clk/sunxi/clk-sun6i-apb0.c +1 -5
 	},
 	.probe =3D sun6i_a31_apb0_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_clk_driver);
drivers/clk/sunxi/clk-= renamed from drivers/clk/sunxi/clk-sun6i-ar100.c +0 -0

sun6i-ar100.c

drivers/clk/sunxi/clk-sun6i-ar100.c static int sun6i_a31_ar100_clk_probe(struct platform_=

Quoted 13 lines

index 84a187e55360..64ca3e9e38e6 100644

drivers/clk/sunxi/clk-sun6i-ar100.c +0 -0
@@ -10,7 +10,7 @@

=20
#include <linux/bitops.h>
#include <linux/clk-provider.h>

drivers/clk/sunxi/clk-sun6i-ar100.c +1 -1
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
@@ -91,32 +91,17 @@ static int sun6i_a31_ar100_clk_probe(struct platform_=

device *pdev)

drivers/clk/sunxi/clk-s=

Quoted 35 lines
drivers/clk/sunxi/clk-sun6i-ar100.c +0 -0
 	return 0;
 }

=20

drivers/clk/sunxi/clk-sun6i-ar100.c +0 -11
-static int sun6i_a31_ar100_clk_remove(struct platform_device *pdev)
-{
-	struct device_node *np =3D pdev->dev.of_node;
-	struct clk *clk =3D platform_get_drvdata(pdev);
-
-	sunxi_factors_unregister(np, clk);
-
-	return 0;
-}
-
 static const struct of_device_id sun6i_a31_ar100_clk_dt_ids[] =3D {
 	{ .compatible =3D "allwinner,sun6i-a31-ar100-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_ar100_clk_dt_ids);

=20
static struct platform_driver sun6i_a31_ar100_clk_driver =3D {

drivers/clk/sunxi/clk-sun6i-ar100.c +2 -6
 	.driver =3D {
 		.name =3D "sun6i-a31-ar100-clk",
 		.of_match_table =3D sun6i_a31_ar100_clk_dt_ids,
+		.suppress_bind_attrs =3D true,
 	},
 	.probe =3D sun6i_a31_ar100_clk_probe,
-	.remove =3D sun6i_a31_ar100_clk_remove,
 };
-module_platform_driver(sun6i_a31_ar100_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_ar100_clk_driver);
drivers/clk/sunxi/clk-s= renamed from drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0

un8i-apb0.c

drivers/clk/sunxi/clk-sun8i-apb0.c static const struct of_device_id sun8i_a23_apb0_clk_d=

Quoted 13 lines

index 2ea61debffc1..a5666e1d0ce7 100644

drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0
@@ -15,7 +15,7 @@
  */

=20
#include <linux/clk-provider.h>

drivers/clk/sunxi/clk-sun8i-apb0.c +1 -1
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -108,7 +108,6 @@ static const struct of_device_id sun8i_a23_apb0_clk_d=

t_ids[] =3D {

drivers/clk/sunxi/clk-sun8i-apb0.c static struct platform_driver sun8i_a23_apb0_clk_driv=

Quoted 8 lines
drivers/clk/sunxi/clk-sun8i-apb0.c +0 -1
 	{ .compatible =3D "allwinner,sun8i-a23-apb0-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun8i_a23_apb0_clk_dt_ids);

=20
static struct platform_driver sun8i_a23_apb0_clk_driver =3D {

drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0
 	.driver =3D {
@@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driv=

er =3D {

drivers/clk/sunxi/clk-su=

Quoted 10 lines
drivers/clk/sunxi/clk-sun8i-apb0.c +1 -5
 	},
 	.probe =3D sun8i_a23_apb0_clk_probe,
 };
-module_platform_driver(sun8i_a23_apb0_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun8i_a23_apb0_clk_driver);
drivers/clk/sunxi/clk-su= renamed from drivers/clk/sunxi/clk-sun9i-mmc.c +0 -0

n9i-mmc.c

Quoted 54 lines

index 716737388b7d..6041bdba2e97 100644

drivers/clk/sunxi/clk-sun9i-mmc.c +0 -0
@@ -16,7 +16,7 @@

=20
#include <linux/clk.h>
#include <linux/clk-provider.h>

drivers/clk/sunxi/clk-sun9i-mmc.c +1 -1
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/reset.h>
@@ -183,39 +183,17 @@ err_clk_register:
 	return ret;
 }

=20

drivers/clk/sunxi/clk-sun9i-mmc.c +0 -18
-static int sun9i_a80_mmc_config_clk_remove(struct platform_device *pdev)
-{
-	struct device_node *np =3D pdev->dev.of_node;
-	struct sun9i_mmc_clk_data *data =3D platform_get_drvdata(pdev);
-	struct clk_onecell_data *clk_data =3D &data->clk_data;
-	int i;
-
-	reset_controller_unregister(&data->rcdev);
-	of_clk_del_provider(np);
-	for (i =3D 0; i < clk_data->clk_num; i++)
-		clk_unregister(clk_data->clks[i]);
-
-	reset_control_assert(data->reset);
-
-	return 0;
-}
-
 static const struct of_device_id sun9i_a80_mmc_config_clk_dt_ids[] =3D {
 	{ .compatible =3D "allwinner,sun9i-a80-mmc-config-clk" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun9i_a80_mmc_config_clk_dt_ids);

=20
static struct platform_driver sun9i_a80_mmc_config_clk_driver =3D {

drivers/clk/sunxi/clk-sun9i-mmc.c +2 -6
 	.driver =3D {
 		.name =3D "sun9i-a80-mmc-config-clk",
+		.suppress_bind_attrs =3D true,
 		.of_match_table =3D sun9i_a80_mmc_config_clk_dt_ids,
 	},
 	.probe =3D sun9i_a80_mmc_config_clk_probe,
-	.remove =3D sun9i_a80_mmc_config_clk_remove,
 };
-module_platform_driver(sun9i_a80_mmc_config_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun9i_a80_mmc_config_clk_driver);
Acked-by on v1 8/10
#24 lore raw

Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular

In reply to Paul Gortmaker
Quoted 33 lines · Paul Gortmaker

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.

Quoted 6 lines
Cc Boris BREZILLON <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Emilio López" <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Maxime Ripard <[email protected]>

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#25 lore raw

Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular

In reply to Paul Gortmaker

Quoting Paul Gortmaker (2016-07-04 14:12:18)

Quoted 42 lines

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. =

Quoted 8 lines
Cc Boris BREZILLON <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Emilio L=C3=B3pez" <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Maxime Ripard <[email protected]>

Applied.

Regards,
Mike

Quoted 7 lines
---
 drivers/clk/sunxi/clk-factors.c          |  1 -
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-apb0.c       |  9 ++-------
 drivers/clk/sunxi/clk-sun6i-ar100.c      | 21 +++------------------
 drivers/clk/sunxi/clk-sun8i-apb0.c       |  9 ++-------

drivers/clk/sunxi/clk-sun9i-mmc.c | 28 +++-----------------------=

--

drivers/clk/sunxi/clk-fact=

Quoted 4 lines
 6 files changed, 12 insertions(+), 65 deletions(-)

=

drivers/clk/sunxi/clk-fact= renamed from drivers/clk/sunxi/clk-factors.c +0 -0

ors.c

drivers/clk/sunxi=

Quoted 12 lines

index ddefe9668863..dfe5e3e32d28 100644

drivers/clk/sunxi/clk-factors.c +0 -1
@@ -12,7 +12,6 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/string.h>
drivers/clk/sunxi= renamed from drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0

/clk-sun6i-apb0-gates.c

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static const struct of_device_id sun6i_a31_apb0_gates_c=

Quoted 14 lines

index 68021fa5ecd9..09cdb9874636 100644

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -1
@@ -9,7 +9,7 @@
  */
 =
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>

#include <linux/platform_device.h>

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
@@ -33,7 +33,6 @@ static const struct of_device_id sun6i_a31_apb0_gates_c=

lk_dt_ids[] =3D {

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static const struct of_device_id sun6i_a31_apb0_gates_c= · line 33

Quoted 1 line
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
        { .compatible =3D "allwinner,sun8i-a23-apb0-gates-clk", .data =3D=

&sun8i_a23_apb0_gates },

drivers/clk/sunxi/clk-sun6i-apb0-gates.c static struct platform_driver sun6i_a31_apb0_gates_cl=

Quoted 8 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -1
        { /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_gates_clk_dt_ids);
 =
 
 static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)

{

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0 -0
@@ -102,8 +101,4 @@ static struct platform_driver sun6i_a31_apb0_gates_cl=

k_driver =3D {

drivers/clk/sunxi/clk-s=

Quoted 10 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -5
        },
        .probe =3D sun6i_a31_apb0_gates_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_gates_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
drivers/clk/sunxi/clk-s= renamed from drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0

un6i-apb0.c

drivers/clk/sunxi/clk-sun6i-apb0.c static const struct of_device_id sun6i_a31_apb0_clk_dt_=

Quoted 15 lines

index e703e1895b76..b9c8d359288c 100644

drivers/clk/sunxi/clk-sun6i-apb0.c +1 -1
@@ -9,7 +9,7 @@
  */
 =
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>

=

drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0
@@ -61,7 +61,6 @@ static const struct of_device_id sun6i_a31_apb0_clk_dt_=

ids[] =3D {

drivers/clk/sunxi/clk-sun6i-apb0.c static struct platform_driver sun6i_a31_apb0_clk_driver=

Quoted 9 lines
drivers/clk/sunxi/clk-sun6i-apb0.c +0 -1
        { .compatible =3D "allwinner,sun6i-a31-apb0-clk" },
        { /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_apb0_clk_dt_ids);
 =
 
 static struct platform_driver sun6i_a31_apb0_clk_driver =3D {
        .driver =3D {
drivers/clk/sunxi/clk-sun6i-apb0.c +0 -0
@@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver=

=3D {

drivers/clk/sunxi/clk-=

Quoted 10 lines
drivers/clk/sunxi/clk-sun6i-apb0.c +1 -5
        },
        .probe =3D sun6i_a31_apb0_clk_probe,
 };
-module_platform_driver(sun6i_a31_apb0_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_clk_driver);
drivers/clk/sunxi/clk-= renamed from drivers/clk/sunxi/clk-sun6i-ar100.c +0 -0

sun6i-ar100.c

drivers/clk/sunxi/clk-sun6i-ar100.c static int sun6i_a31_ar100_clk_probe(struct platform_=

Quoted 14 lines

index 84a187e55360..64ca3e9e38e6 100644

drivers/clk/sunxi/clk-sun6i-ar100.c +1 -1
@@ -10,7 +10,7 @@
 =
 
 #include <linux/bitops.h>
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>

#include <linux/spinlock.h>

drivers/clk/sunxi/clk-sun6i-ar100.c +0 -0
@@ -91,32 +91,17 @@ static int sun6i_a31_ar100_clk_probe(struct platform_=

device *pdev)

drivers/clk/sunxi/clk-s=

Quoted 37 lines
drivers/clk/sunxi/clk-sun6i-ar100.c +2 -17
        return 0;
 }
 =
 
-static int sun6i_a31_ar100_clk_remove(struct platform_device *pdev)
-{
-       struct device_node *np =3D pdev->dev.of_node;
-       struct clk *clk =3D platform_get_drvdata(pdev);
-
-       sunxi_factors_unregister(np, clk);
-
-       return 0;
-}
-
 static const struct of_device_id sun6i_a31_ar100_clk_dt_ids[] =3D {
        { .compatible =3D "allwinner,sun6i-a31-ar100-clk" },
        { /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun6i_a31_ar100_clk_dt_ids);
 =
 
 static struct platform_driver sun6i_a31_ar100_clk_driver =3D {
        .driver =3D {
                .name =3D "sun6i-a31-ar100-clk",
                .of_match_table =3D sun6i_a31_ar100_clk_dt_ids,
+               .suppress_bind_attrs =3D true,
        },
        .probe =3D sun6i_a31_ar100_clk_probe,
-       .remove =3D sun6i_a31_ar100_clk_remove,
 };
-module_platform_driver(sun6i_a31_ar100_clk_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_ar100_clk_driver);
drivers/clk/sunxi/clk-s= renamed from drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0

un8i-apb0.c

drivers/clk/sunxi/clk-sun8i-apb0.c static const struct of_device_id sun8i_a23_apb0_clk_d=

Quoted 14 lines

index 2ea61debffc1..a5666e1d0ce7 100644

drivers/clk/sunxi/clk-sun8i-apb0.c +1 -1
@@ -15,7 +15,7 @@
  */
 =
 
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>

#include <linux/platform_device.h>

drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0
@@ -108,7 +108,6 @@ static const struct of_device_id sun8i_a23_apb0_clk_d=

t_ids[] =3D {

drivers/clk/sunxi/clk-sun8i-apb0.c static struct platform_driver sun8i_a23_apb0_clk_driv=

Quoted 9 lines
drivers/clk/sunxi/clk-sun8i-apb0.c +0 -1
        { .compatible =3D "allwinner,sun8i-a23-apb0-clk" },
        { /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun8i_a23_apb0_clk_dt_ids);
 =
 
 static struct platform_driver sun8i_a23_apb0_clk_driver =3D {
        .driver =3D {
drivers/clk/sunxi/clk-sun8i-apb0.c +0 -0
@@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driv=

er =3D {

drivers/clk/sunxi/clk-su=

Quoted 10 lines
drivers/clk/sunxi/clk-sun8i-apb0.c +1 -5
        },
        .probe =3D sun8i_a23_apb0_clk_probe,
 };
-module_platform_driver(sun8i_a23_apb0_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun8i_a23_apb0_clk_driver);
drivers/clk/sunxi/clk-su= renamed from drivers/clk/sunxi/clk-sun9i-mmc.c +0 -0

n9i-mmc.c

Quoted 61 lines

index 716737388b7d..6041bdba2e97 100644

drivers/clk/sunxi/clk-sun9i-mmc.c +1 -1
@@ -16,7 +16,7 @@
 =
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>

#include <linux/reset.h>

drivers/clk/sunxi/clk-sun9i-mmc.c +2 -25
@@ -183,39 +183,17 @@ err_clk_register:
        return ret;
 }
 =
 
-static int sun9i_a80_mmc_config_clk_remove(struct platform_device *pdev)
-{
-       struct device_node *np =3D pdev->dev.of_node;
-       struct sun9i_mmc_clk_data *data =3D platform_get_drvdata(pdev);
-       struct clk_onecell_data *clk_data =3D &data->clk_data;
-       int i;
-
-       reset_controller_unregister(&data->rcdev);
-       of_clk_del_provider(np);
-       for (i =3D 0; i < clk_data->clk_num; i++)
-               clk_unregister(clk_data->clks[i]);
-
-       reset_control_assert(data->reset);
-
-       return 0;
-}
-
 static const struct of_device_id sun9i_a80_mmc_config_clk_dt_ids[] =3D {
        { .compatible =3D "allwinner,sun9i-a80-mmc-config-clk" },
        { /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, sun9i_a80_mmc_config_clk_dt_ids);
 =
 
 static struct platform_driver sun9i_a80_mmc_config_clk_driver =3D {
        .driver =3D {
                .name =3D "sun9i-a80-mmc-config-clk",
+               .suppress_bind_attrs =3D true,
                .of_match_table =3D sun9i_a80_mmc_config_clk_dt_ids,
        },
        .probe =3D sun9i_a80_mmc_config_clk_probe,
-       .remove =3D sun9i_a80_mmc_config_clk_remove,
 };
-module_platform_driver(sun9i_a80_mmc_config_clk_driver);
-
-MODULE_AUTHOR("Chen-Yu Tsai <[email protected]>");
-MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun9i_a80_mmc_config_clk_driver);
-- =

2.8.4
=20

#26 lore raw

PATCH 9/10 clk: tegra: make clk-tegra124-dfll-fcpu explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-tegra/Kconfig:config ARCH_TEGRA_124_SOC
arch/arm/mach-tegra/Kconfig: bool "Enable support for Tegra124 family"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Peter De Schrijver <[email protected]>
Cc Prashant Gaikwad <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Aleksandr Frid <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +2 -14
index c205809ba580..4301569d072a 100644
@@ -20,7 +20,7 @@
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <soc/tegra/fuse.h>
 
@@ -148,7 +148,6 @@ static const struct of_device_id tegra124_dfll_fcpu_of_match[] = {
 	{ .compatible = "nvidia,tegra124-dfll", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra124_dfll_fcpu_of_match);
 
 static const struct dev_pm_ops tegra124_dfll_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra_dfll_runtime_suspend,
@@ -169,15 +168,4 @@ static int __init tegra124_dfll_fcpu_init(void)
 {
 	return platform_driver_register(&tegra124_dfll_fcpu_driver);
 }
-module_init(tegra124_dfll_fcpu_init);
-
-static void __exit tegra124_dfll_fcpu_exit(void)
-{
-	platform_driver_unregister(&tegra124_dfll_fcpu_driver);
-}
-module_exit(tegra124_dfll_fcpu_exit);
-
-MODULE_DESCRIPTION("Tegra124 DFLL clock source driver");
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Aleksandr Frid <[email protected]>");
-MODULE_AUTHOR("Paul Walmsley <[email protected]>");
+device_initcall(tegra124_dfll_fcpu_init);
Signature · 1 line
2.8.4
Applied
#27 lore raw

Re: [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu explicitly non-modular

Quoted 30 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-tegra/Kconfig:config ARCH_TEGRA_124_SOC
arch/arm/mach-tegra/Kconfig: bool "Enable support for Tegra124 family"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Peter De Schrijver <[email protected]>
Cc Prashant Gaikwad <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Aleksandr Frid <[email protected]>
Cc Paul Walmsley <[email protected]>
Quoted 1 line

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#28 lore raw

PATCH 10/10 clk: ti: make clk-dra7-atl explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-omap2/Kconfig:config SOC_DRA7XX
arch/arm/mach-omap2/Kconfig: bool "TI DRA7XX"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Cc Tero Kristo <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Stephen Boyd <[email protected]>
---
 drivers/clk/ti/clk-dra7-atl.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)
drivers/clk/ti/clk-dra7-atl.c +3 -17
index c77333230bdf..45d05339d583 100644
@@ -15,7 +15,7 @@
  * GNU General Public License for more details.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/slab.h>
@@ -295,31 +295,17 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int of_dra7_atl_clk_remove(struct platform_device *pdev)
-{
-	pm_runtime_disable(&pdev->dev);
-
-	return 0;
-}
-
 static const struct of_device_id of_dra7_atl_clk_match_tbl[] = {
 	{ .compatible = "ti,dra7-atl", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, of_dra7_atl_clk_match_tbl);
 
 static struct platform_driver dra7_atl_clk_driver = {
 	.driver = {
 		.name = "dra7-atl",
+		.suppress_bind_attrs = true,
 		.of_match_table = of_dra7_atl_clk_match_tbl,
 	},
 	.probe = of_dra7_atl_clk_probe,
-	.remove = of_dra7_atl_clk_remove,
 };
-
-module_platform_driver(dra7_atl_clk_driver);
-
-MODULE_DESCRIPTION("Clock driver for DRA7 Audio Tracking Logic");
-MODULE_ALIAS("platform:dra7-atl-clock");
-MODULE_AUTHOR("Peter Ujfalusi <[email protected]>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dra7_atl_clk_driver);
Signature · 1 line
2.8.4
Applied
#29 lore raw

Re: [PATCH 10/10] clk: ti: make clk-dra7-atl explicitly non-modular

Quoted 23 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/arm/mach-omap2/Kconfig:config SOC_DRA7XX
arch/arm/mach-omap2/Kconfig: bool "TI DRA7XX"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

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.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tags etc. since all that information is already contained at the top of the file in the comments.

Quoted 8 lines
Cc Tero Kristo <[email protected]>
Cc Michael Turquette <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Stephen Boyd <[email protected]>

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project