linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] clk: fix/remove module usage in non-modular code
@ 2016-07-04 21:12 Paul Gortmaker
  2016-07-04 21:12 ` [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker
                   ` (9 more replies)
  0 siblings, 10 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Aleksandr Frid, Alexandre Courbot,
	Boris BREZILLON, Carlo Caione, Chen-Yu Tsai, Emilio López,
	Kevin Hilman, Krzysztof Kozlowski, Kukjin Kim, Maxime Ripard,
	Michael Turquette, Neil Armstrong, Padmavathi Venna,
	Paul Walmsley, Peter De Schrijver, Peter Ujfalusi,
	Prashant Gaikwad, Stephen Boyd, Stephen Warren,
	Sylwester Nawrocki, Tero Kristo, Thierry Reding,
	Thomas Petazzoni, Tomasz Figa, linux-amlogic, linux-clk,
	linux-omap, linux-samsung-soc, linux-tegra

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 <afrid@nvidia.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Padmavathi Venna <padma.v@samsung.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>

Cc: linux-amlogic@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-tegra@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(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/10] clk: meson8b: make it explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-06 22:21   ` Michael Turquette
  2016-07-04 21:12 ` [PATCH 02/10] clk: meson: make gxbb " Paul Gortmaker
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Michael Turquette, Stephen Boyd, Carlo Caione,
	Kevin Hilman, linux-clk, linux-amlogic

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 <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/meson/meson8b-clkc.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/clk/meson/meson8b-clkc.c b/drivers/clk/meson/meson8b-clkc.c
index b1902e91213d..4c9413cdf373 100644
--- a/drivers/clk/meson/meson8b-clkc.c
+++ b/drivers/clk/meson/meson8b-clkc.c
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S805 / Meson8b Clock Controller Driver
+ *
  * Copyright (c) 2015 Endless Mobile, Inc.
  * Author: Carlo Caione <carlo@endlessm.com>
  *
@@ -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 <mturquette@baylibre.com>");
-MODULE_AUTHOR("Carlo Caione <carlo@endlessm.com>");
+device_initcall(meson8b_clkc_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/10] clk: meson: make gxbb explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
  2016-07-04 21:12 ` [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-06 22:21   ` Michael Turquette
  2016-07-04 21:12 ` [PATCH 03/10] clk: mvebu: make cp110-system-controller " Paul Gortmaker
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Michael Turquette, Stephen Boyd, Carlo Caione,
	Kevin Hilman, linux-clk, linux-amlogic

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 <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/meson/gxbb.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
index 007b7157cf4b..a4c6684b3019 100644
--- a/drivers/clk/meson/gxbb.c
+++ b/drivers/clk/meson/gxbb.c
@@ -1,4 +1,6 @@
 /*
+ * AmLogic S905 / GXBB Clock Controller Driver
+ *
  * Copyright (c) 2016 AmLogic, Inc.
  * Michael Turquette <mturquette@baylibre.com>
  *
@@ -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 <mturquette@baylibre.com>");
+device_initcall(gxbb_clkc_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/10] clk: mvebu: make cp110-system-controller explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
  2016-07-04 21:12 ` [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker
  2016-07-04 21:12 ` [PATCH 02/10] clk: meson: make gxbb " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-11-04 20:32   ` Stephen Boyd
  2016-07-04 21:12 ` [PATCH 04/10] clk: mvebu: make ap806-system-controller " Paul Gortmaker
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Michael Turquette, Stephen Boyd,
	Thomas Petazzoni, linux-clk

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 <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/mvebu/cp110-system-controller.c | 34 +++--------------------------
 1 file changed, 3 insertions(+), 31 deletions(-)

diff --git a/drivers/clk/mvebu/cp110-system-controller.c b/drivers/clk/mvebu/cp110-system-controller.c
index 7fa42d6b2b92..15c8b76cc27f 100644
--- a/drivers/clk/mvebu/cp110-system-controller.c
+++ b/drivers/clk/mvebu/cp110-system-controller.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(cp110_syscon_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/10] clk: mvebu: make ap806-system-controller explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (2 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 03/10] clk: mvebu: make cp110-system-controller " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-11-04 20:33   ` Stephen Boyd
  2016-07-04 21:12 ` [PATCH 05/10] clk: oxnas: make it " Paul Gortmaker
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Michael Turquette, Stephen Boyd,
	Thomas Petazzoni, linux-clk

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 <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/mvebu/ap806-system-controller.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index 02023baf86c9..8181b919f062 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(ap806_syscon_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/10] clk: oxnas: make it explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (3 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 04/10] clk: mvebu: make ap806-system-controller " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-06 13:11   ` Neil Armstrong
  2016-07-06 22:21   ` Michael Turquette
  2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Michael Turquette, Stephen Boyd, Neil Armstrong,
	linux-clk

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 <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/clk-oxnas.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-oxnas.c b/drivers/clk/clk-oxnas.c
index 79bcb2e42060..47649ac5d399 100644
--- a/drivers/clk/clk-oxnas.c
+++ b/drivers/clk/clk-oxnas.c
@@ -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);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (4 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 05/10] clk: oxnas: make it " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-05  9:04   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2016-07-04 21:12 ` [PATCH 07/10] clk: samsung: make clk-s5pv210-audss " Paul Gortmaker
                   ` (3 subsequent siblings)
  9 siblings, 3 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Sylwester Nawrocki, Tomasz Figa,
	Michael Turquette, Stephen Boyd, Kukjin Kim, Krzysztof Kozlowski,
	Padmavathi Venna, linux-samsung-soc, linux-clk

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 <s.nawrocki@samsung.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Padmavathi Venna <padma.v@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/samsung/clk-exynos-audss.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 4e9584d79089..42b62f865198 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -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 <padma.v@samsung.com>");
-MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:exynos-audss-clk");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (5 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-06 10:49   ` Sylwester Nawrocki
  2016-07-13 10:32   ` Sylwester Nawrocki
  2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Sylwester Nawrocki, Tomasz Figa,
	Michael Turquette, Stephen Boyd, linux-samsung-soc, linux-clk

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 <s.nawrocki@samsung.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/samsung/clk-s5pv210-audss.c | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/drivers/clk/samsung/clk-s5pv210-audss.c b/drivers/clk/samsung/clk-s5pv210-audss.c
index eefb84b22566..c66ed2d1450e 100644
--- a/drivers/clk/samsung/clk-s5pv210-audss.c
+++ b/drivers/clk/samsung/clk-s5pv210-audss.c
@@ -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 <t.figa@samsung.com>");
-MODULE_DESCRIPTION("S5PV210 Audio Subsystem Clock Controller");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:s5pv210-audss-clk");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (6 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 07/10] clk: samsung: make clk-s5pv210-audss " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-07-04 21:36   ` Boris Brezillon
                     ` (2 more replies)
  2016-07-04 21:12 ` [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu " Paul Gortmaker
  2016-07-04 21:12 ` [PATCH 10/10] clk: ti: make clk-dra7-atl " Paul Gortmaker
  9 siblings, 3 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Chen-Yu Tsai, Emilio López,
	Michael Turquette, Stephen Boyd, Maxime Ripard, linux-clk

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 <boris.brezillon@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

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 @@
 #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>
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 @@
  */
 
 #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 <boris.brezillon@free-electrons.com>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
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 @@
  */
 
 #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 <boris.brezillon@free-electrons.com>");
-MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_apb0_clk_driver);
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 @@
 
 #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 <boris.brezillon@free-electrons.com>");
-MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_a31_ar100_clk_driver);
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 @@
  */
 
 #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 <wens@csie.org>");
-MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun8i_a23_apb0_clk_driver);
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 @@
 
 #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 <wens@csie.org>");
-MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun9i_a80_mmc_config_clk_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (7 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-11-04 20:33   ` Stephen Boyd
  2016-07-04 21:12 ` [PATCH 10/10] clk: ti: make clk-dra7-atl " Paul Gortmaker
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Peter De Schrijver, Prashant Gaikwad,
	Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, Aleksandr Frid, Paul Walmsley, linux-clk,
	linux-tegra

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 <pdeschrijver@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Aleksandr Frid <afrid@nvidia.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
index c205809ba580..4301569d072a 100644
--- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
+++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
@@ -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 <afrid@nvidia.com>");
-MODULE_AUTHOR("Paul Walmsley <pwalmsley@nvidia.com>");
+device_initcall(tegra124_dfll_fcpu_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/10] clk: ti: make clk-dra7-atl explicitly non-modular
  2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
                   ` (8 preceding siblings ...)
  2016-07-04 21:12 ` [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu " Paul Gortmaker
@ 2016-07-04 21:12 ` Paul Gortmaker
  2016-11-04 20:35   ` Stephen Boyd
  9 siblings, 1 reply; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-04 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Tero Kristo, Michael Turquette, Peter Ujfalusi,
	Stephen Boyd, linux-omap, linux-clk

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 <t-kristo@ti.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-omap@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/clk/ti/clk-dra7-atl.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index c77333230bdf..45d05339d583 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -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 <peter.ujfalusi@ti.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dra7_atl_clk_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
  2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
@ 2016-07-04 21:36   ` Boris Brezillon
  2016-07-05  6:13   ` Maxime Ripard
  2016-07-06 22:22   ` Michael Turquette
  2 siblings, 0 replies; 30+ messages in thread
From: Boris Brezillon @ 2016-07-04 21:36 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Chen-Yu Tsai, Emilio López, Michael Turquette,
	Stephen Boyd, Maxime Ripard, linux-clk

On Mon, 4 Jul 2016 17:12:18 -0400
Paul Gortmaker <paul.gortmaker@windriver.com> wrote:

> 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
> 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 <boris.brezillon@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: "Emilio L=C3=B3pez" <emilio@elopez.com.ar>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  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(-)
>=20
> diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-fact=
ors.c
> index ddefe9668863..dfe5e3e32d28 100644
> --- a/drivers/clk/sunxi/clk-factors.c
> +++ b/drivers/clk/sunxi/clk-factors.c
> @@ -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>
> 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 @@
>   */
> =20
>  #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_c=
lk_dt_ids[] =3D {
>  	{ .compatible =3D "allwinner,sun8i-a23-apb0-gates-clk", .data =3D &sun8=
i_a23_apb0_gates },
>  	{ /* 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)
>  {
> @@ -102,8 +101,4 @@ static struct platform_driver sun6i_a31_apb0_gates_cl=
k_driver =3D {
>  	},
>  	.probe =3D sun6i_a31_apb0_gates_clk_probe,
>  };
> -module_platform_driver(sun6i_a31_apb0_gates_clk_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0.c b/drivers/clk/sunxi/clk-s=
un6i-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 @@
>   */
> =20
>  #include <linux/clk-provider.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
> =20
> @@ -61,7 +61,6 @@ static const struct of_device_id sun6i_a31_apb0_clk_dt_=
ids[] =3D {
>  	{ .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 {
>  	.driver =3D {
> @@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver=
 =3D {
>  	},
>  	.probe =3D sun6i_a31_apb0_clk_probe,
>  };
> -module_platform_driver(sun6i_a31_apb0_clk_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_apb0_clk_driver);
> 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 @@
> =20
>  #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;
>  }
> =20
> -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 {
>  	.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 <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_ar100_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun8i-apb0.c b/drivers/clk/sunxi/clk-s=
un8i-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 @@
>   */
> =20
>  #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_d=
t_ids[] =3D {
>  	{ .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 {
>  	.driver =3D {
> @@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driv=
er =3D {
>  	},
>  	.probe =3D sun8i_a23_apb0_clk_probe,
>  };
> -module_platform_driver(sun8i_a23_apb0_clk_driver);
> -
> -MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
> -MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun8i_a23_apb0_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-su=
n9i-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 @@
> =20
>  #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;
>  }
> =20
> -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 {
>  	.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 <wens@csie.org>");
> -MODULE_DESCRIPTION("Allwinner A80 MMC clock/reset Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun9i_a80_mmc_config_clk_driver);

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
  2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
  2016-07-04 21:36   ` Boris Brezillon
@ 2016-07-05  6:13   ` Maxime Ripard
  2016-07-06 22:22   ` Michael Turquette
  2 siblings, 0 replies; 30+ messages in thread
From: Maxime Ripard @ 2016-07-05  6:13 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Boris BREZILLON, Chen-Yu Tsai, Emilio López,
	Michael Turquette, Stephen Boyd, linux-clk

[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]

On Mon, Jul 04, 2016 at 05:12:18PM -0400, Paul Gortmaker wrote:
> 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 <boris.brezillon@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: "Emilio López" <emilio@elopez.com.ar>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
@ 2016-07-05  9:04   ` Krzysztof Kozlowski
  2016-07-05 13:32     ` Paul Gortmaker
  2016-07-05 11:02   ` Geert Uytterhoeven
  2016-07-07 13:12   ` Sylwester Nawrocki
  2 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-05  9:04 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Sylwester Nawrocki, Tomasz Figa, Michael Turquette, Stephen Boyd,
	Kukjin Kim, linux-samsung-soc, linux-clk

On 07/04/2016 11:12 PM, Paul Gortmaker wrote:
> 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 <s.nawrocki@samsung.com>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: Padmavathi Venna <padma.v@samsung.com>
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 4e9584d79089..42b62f865198 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -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 <padma.v@samsung.com>");
> -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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
  2016-07-05  9:04   ` Krzysztof Kozlowski
@ 2016-07-05 11:02   ` Geert Uytterhoeven
  2016-07-05 13:17     ` Paul Gortmaker
  2016-07-07 13:12   ` Sylwester Nawrocki
  2 siblings, 1 reply; 30+ messages in thread
From: Geert Uytterhoeven @ 2016-07-05 11:02 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd, Kukjin Kim, Krzysztof Kozlowski, Padmavathi Venna,
	linux-samsung-soc, linux-clk

Hi Paul,

On Mon, Jul 4, 2016 at 11:12 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> 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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-05 11:02   ` Geert Uytterhoeven
@ 2016-07-05 13:17     ` Paul Gortmaker
  0 siblings, 0 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-05 13:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-kernel, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd, Kukjin Kim, Krzysztof Kozlowski, Padmavathi Venna,
	linux-samsung-soc, linux-clk

[Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular] On 05/07/2016 (Tue 13:02) Geert Uytterhoeven wrote:

> Hi Paul,
> 
> On Mon, Jul 4, 2016 at 11:12 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > 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.
--

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> 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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-05  9:04   ` Krzysztof Kozlowski
@ 2016-07-05 13:32     ` Paul Gortmaker
  0 siblings, 0 replies; 30+ messages in thread
From: Paul Gortmaker @ 2016-07-05 13:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd, Kukjin Kim, linux-samsung-soc, linux-clk

[Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular] On 05/07/2016 (Tue 11:04) Krzysztof Kozlowski wrote:

> On 07/04/2016 11:12 PM, Paul Gortmaker wrote:
> > 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.
> > 

[...]

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

> 
> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular
  2016-07-04 21:12 ` [PATCH 07/10] clk: samsung: make clk-s5pv210-audss " Paul Gortmaker
@ 2016-07-06 10:49   ` Sylwester Nawrocki
  2016-07-13 10:32   ` Sylwester Nawrocki
  1 sibling, 0 replies; 30+ messages in thread
From: Sylwester Nawrocki @ 2016-07-06 10:49 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Tomasz Figa, Michael Turquette, Stephen Boyd,
	linux-samsung-soc, linux-clk

Patch applied, thanks.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular
  2016-07-04 21:12 ` [PATCH 05/10] clk: oxnas: make it " Paul Gortmaker
@ 2016-07-06 13:11   ` Neil Armstrong
  2016-07-06 22:21   ` Michael Turquette
  1 sibling, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2016-07-06 13:11 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Linux Kernel Mailing List, Michael Turquette, Stephen Boyd, linux-clk

2016-07-04 23:12 GMT+02:00 Paul Gortmaker <paul.gortmaker@windriver.com>:
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/clk/clk-oxnas.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
>

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 01/10] clk: meson8b: make it explicitly non-modular
  2016-07-04 21:12 ` [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker
@ 2016-07-06 22:21   ` Michael Turquette
  0 siblings, 0 replies; 30+ messages in thread
From: Michael Turquette @ 2016-07-06 22:21 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Paul Gortmaker, Stephen Boyd, Carlo Caione, Kevin Hilman,
	linux-clk, linux-amlogic

Quoting Paul Gortmaker (2016-07-04 14:12:11)
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Carlo Caione <carlo@caione.org>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-amlogic@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied.

Regards,
Mike

> ---
>  drivers/clk/meson/meson8b-clkc.c | 19 ++++---------------
>  1 file changed, 4 insertions(+), 15 deletions(-)
> =

> diff --git a/drivers/clk/meson/meson8b-clkc.c b/drivers/clk/meson/meson8b=
-clkc.c
> index b1902e91213d..4c9413cdf373 100644
> --- a/drivers/clk/meson/meson8b-clkc.c
> +++ b/drivers/clk/meson/meson8b-clkc.c
> @@ -1,4 +1,6 @@
>  /*
> + * AmLogic S805 / Meson8b Clock Controller Driver
> + *
>   * Copyright (c) 2015 Endless Mobile, Inc.
>   * Author: Carlo Caione <carlo@endlessm.com>
>   *
> @@ -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_t=
able[] =3D {
>         { .compatible =3D "amlogic,meson8b-clkc" },
>         { }
>  };
> -MODULE_DEVICE_TABLE(of, meson8b_match_table);
>  =

>  static struct platform_driver meson8b_driver =3D {
>         .probe          =3D 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 <mturquette@baylibre.com>");
> -MODULE_AUTHOR("Carlo Caione <carlo@endlessm.com>");
> +device_initcall(meson8b_clkc_init);
> -- =

> 2.8.4
>=20

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 02/10] clk: meson: make gxbb explicitly non-modular
  2016-07-04 21:12 ` [PATCH 02/10] clk: meson: make gxbb " Paul Gortmaker
@ 2016-07-06 22:21   ` Michael Turquette
  0 siblings, 0 replies; 30+ messages in thread
From: Michael Turquette @ 2016-07-06 22:21 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Paul Gortmaker, Stephen Boyd, Carlo Caione, Kevin Hilman,
	linux-clk, linux-amlogic

Quoting Paul Gortmaker (2016-07-04 14:12:12)
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Carlo Caione <carlo@caione.org>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-amlogic@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied.

Regards,
Mike

> ---
>  drivers/clk/meson/gxbb.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> =

> diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
> index 007b7157cf4b..a4c6684b3019 100644
> --- a/drivers/clk/meson/gxbb.c
> +++ b/drivers/clk/meson/gxbb.c
> @@ -1,4 +1,6 @@
>  /*
> + * AmLogic S905 / GXBB Clock Controller Driver
> + *
>   * Copyright (c) 2016 AmLogic, Inc.
>   * Michael Turquette <mturquette@baylibre.com>
>   *
> @@ -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_tabl=
e[] =3D {
>         { .compatible =3D "amlogic,gxbb-clkc" },
>         { }
>  };
> -MODULE_DEVICE_TABLE(of, gxbb_match_table);
>  =

>  static struct platform_driver gxbb_driver =3D {
>         .probe          =3D 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 <mturquette@baylibre.com>");
> +device_initcall(gxbb_clkc_init);
> -- =

> 2.8.4
>=20

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular
  2016-07-04 21:12 ` [PATCH 05/10] clk: oxnas: make it " Paul Gortmaker
  2016-07-06 13:11   ` Neil Armstrong
@ 2016-07-06 22:21   ` Michael Turquette
  1 sibling, 0 replies; 30+ messages in thread
From: Michael Turquette @ 2016-07-06 22:21 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Paul Gortmaker, Stephen Boyd, Neil Armstrong, linux-clk

Quoting Paul Gortmaker (2016-07-04 14:12:15)
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied.

Regards,
Mike

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

> diff --git a/drivers/clk/clk-oxnas.c b/drivers/clk/clk-oxnas.c
> index 79bcb2e42060..47649ac5d399 100644
> --- a/drivers/clk/clk-oxnas.c
> +++ b/drivers/clk/clk-oxnas.c
> @@ -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_devic=
e *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[] =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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
  2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
  2016-07-04 21:36   ` Boris Brezillon
  2016-07-05  6:13   ` Maxime Ripard
@ 2016-07-06 22:22   ` Michael Turquette
  2 siblings, 0 replies; 30+ messages in thread
From: Michael Turquette @ 2016-07-06 22:22 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Chen-Yu Tsai, Emilio López,
	Stephen Boyd, Maxime Ripard, linux-clk

Quoting Paul Gortmaker (2016-07-04 14:12:18)
> 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 <boris.brezillon@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: "Emilio L=C3=B3pez" <emilio@elopez.com.ar>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied.

Regards,
Mike

> ---
>  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(-)
> =

> diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-fact=
ors.c
> index ddefe9668863..dfe5e3e32d28 100644
> --- a/drivers/clk/sunxi/clk-factors.c
> +++ b/drivers/clk/sunxi/clk-factors.c
> @@ -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>
> 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 @@
>   */
>  =

>  #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_c=
lk_dt_ids[] =3D {
>         { .compatible =3D "allwinner,sun8i-a23-apb0-gates-clk", .data =3D=
 &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_cl=
k_driver =3D {
>         },
>         .probe =3D sun6i_a31_apb0_gates_clk_probe,
>  };
> -module_platform_driver(sun6i_a31_apb0_gates_clk_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 APB0 gate clocks driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_apb0_gates_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0.c b/drivers/clk/sunxi/clk-s=
un6i-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 @@
>   */
>  =

>  #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[] =3D {
>         { .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 {
> @@ -70,8 +69,4 @@ static struct platform_driver sun6i_a31_apb0_clk_driver=
 =3D {
>         },
>         .probe =3D sun6i_a31_apb0_clk_probe,
>  };
> -module_platform_driver(sun6i_a31_apb0_clk_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 APB0 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_apb0_clk_driver);
> 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 @@
>  =

>  #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 =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 <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner A31 AR100 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_a31_ar100_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun8i-apb0.c b/drivers/clk/sunxi/clk-s=
un8i-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 @@
>   */
>  =

>  #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_d=
t_ids[] =3D {
>         { .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 {
> @@ -117,8 +116,4 @@ static struct platform_driver sun8i_a23_apb0_clk_driv=
er =3D {
>         },
>         .probe =3D sun8i_a23_apb0_clk_probe,
>  };
> -module_platform_driver(sun8i_a23_apb0_clk_driver);
> -
> -MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
> -MODULE_DESCRIPTION("Allwinner A23 APB0 clock Driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun8i_a23_apb0_clk_driver);
> diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-su=
n9i-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 @@
>  =

>  #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 =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 <wens@csie.org>");
> -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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
  2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
  2016-07-05  9:04   ` Krzysztof Kozlowski
  2016-07-05 11:02   ` Geert Uytterhoeven
@ 2016-07-07 13:12   ` Sylwester Nawrocki
  2 siblings, 0 replies; 30+ messages in thread
From: Sylwester Nawrocki @ 2016-07-07 13:12 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Tomasz Figa, Michael Turquette, Stephen Boyd,
	Kukjin Kim, Krzysztof Kozlowski, linux-samsung-soc, linux-clk

On 07/04/2016 11:12 PM, Paul Gortmaker wrote:
> 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.
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

>  #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);

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.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular
  2016-07-04 21:12 ` [PATCH 07/10] clk: samsung: make clk-s5pv210-audss " Paul Gortmaker
  2016-07-06 10:49   ` Sylwester Nawrocki
@ 2016-07-13 10:32   ` Sylwester Nawrocki
  2016-07-13 21:59     ` Michael Turquette
  1 sibling, 1 reply; 30+ messages in thread
From: Sylwester Nawrocki @ 2016-07-13 10:32 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Paul Gortmaker, linux-kernel, Tomasz Figa, linux-samsung-soc, linux-clk

On 07/04/2016 11:12 PM, Paul Gortmaker wrote:
> 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 <s.nawrocki@samsung.com>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

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

Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 07/10] clk: samsung: make clk-s5pv210-audss explicitly non-modular
  2016-07-13 10:32   ` Sylwester Nawrocki
@ 2016-07-13 21:59     ` Michael Turquette
  0 siblings, 0 replies; 30+ messages in thread
From: Michael Turquette @ 2016-07-13 21:59 UTC (permalink / raw)
  To: Sylwester Nawrocki, Stephen Boyd
  Cc: Paul Gortmaker, linux-kernel, Tomasz Figa, linux-samsung-soc, linux-clk

Quoting Sylwester Nawrocki (2016-07-13 03:32:42)
> On 07/04/2016 11:12 PM, Paul Gortmaker wrote:
> > 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 <s.nawrocki@samsung.com>
> > Cc: Tomasz Figa <tomasz.figa@gmail.com>
> > Cc: Michael Turquette <mturquette@baylibre.com>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Cc: linux-samsung-soc@vger.kernel.org
> > Cc: linux-clk@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> =

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

> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> =


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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 03/10] clk: mvebu: make cp110-system-controller explicitly non-modular
  2016-07-04 21:12 ` [PATCH 03/10] clk: mvebu: make cp110-system-controller " Paul Gortmaker
@ 2016-11-04 20:32   ` Stephen Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Boyd @ 2016-11-04 20:32 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Michael Turquette, Thomas Petazzoni, linux-clk

On 07/04, Paul Gortmaker wrote:
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 04/10] clk: mvebu: make ap806-system-controller explicitly non-modular
  2016-07-04 21:12 ` [PATCH 04/10] clk: mvebu: make ap806-system-controller " Paul Gortmaker
@ 2016-11-04 20:33   ` Stephen Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Boyd @ 2016-11-04 20:33 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Michael Turquette, Thomas Petazzoni, linux-clk

On 07/04, Paul Gortmaker wrote:
> 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 <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu explicitly non-modular
  2016-07-04 21:12 ` [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu " Paul Gortmaker
@ 2016-11-04 20:33   ` Stephen Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Boyd @ 2016-11-04 20:33 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Peter De Schrijver, Prashant Gaikwad,
	Michael Turquette, Stephen Warren, Thierry Reding,
	Alexandre Courbot, Aleksandr Frid, Paul Walmsley, linux-clk,
	linux-tegra

On 07/04, Paul Gortmaker wrote:
> 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 <pdeschrijver@nvidia.com>
> Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: Aleksandr Frid <afrid@nvidia.com>
> Cc: Paul Walmsley <pwalmsley@nvidia.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-tegra@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/10] clk: ti: make clk-dra7-atl explicitly non-modular
  2016-07-04 21:12 ` [PATCH 10/10] clk: ti: make clk-dra7-atl " Paul Gortmaker
@ 2016-11-04 20:35   ` Stephen Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Boyd @ 2016-11-04 20:35 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Tero Kristo, Michael Turquette, Peter Ujfalusi,
	linux-omap, linux-clk

On 07/04, Paul Gortmaker wrote:
> 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 <t-kristo@ti.com>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-omap@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-11-04 20:35 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04 21:12 [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker
2016-07-04 21:12 ` [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker
2016-07-06 22:21   ` Michael Turquette
2016-07-04 21:12 ` [PATCH 02/10] clk: meson: make gxbb " Paul Gortmaker
2016-07-06 22:21   ` Michael Turquette
2016-07-04 21:12 ` [PATCH 03/10] clk: mvebu: make cp110-system-controller " Paul Gortmaker
2016-11-04 20:32   ` Stephen Boyd
2016-07-04 21:12 ` [PATCH 04/10] clk: mvebu: make ap806-system-controller " Paul Gortmaker
2016-11-04 20:33   ` Stephen Boyd
2016-07-04 21:12 ` [PATCH 05/10] clk: oxnas: make it " Paul Gortmaker
2016-07-06 13:11   ` Neil Armstrong
2016-07-06 22:21   ` Michael Turquette
2016-07-04 21:12 ` [PATCH 06/10] clk: samsung make clk-exynos-audss " Paul Gortmaker
2016-07-05  9:04   ` Krzysztof Kozlowski
2016-07-05 13:32     ` Paul Gortmaker
2016-07-05 11:02   ` Geert Uytterhoeven
2016-07-05 13:17     ` Paul Gortmaker
2016-07-07 13:12   ` Sylwester Nawrocki
2016-07-04 21:12 ` [PATCH 07/10] clk: samsung: make clk-s5pv210-audss " Paul Gortmaker
2016-07-06 10:49   ` Sylwester Nawrocki
2016-07-13 10:32   ` Sylwester Nawrocki
2016-07-13 21:59     ` Michael Turquette
2016-07-04 21:12 ` [PATCH 08/10] clk: sunxi: make clk-* " Paul Gortmaker
2016-07-04 21:36   ` Boris Brezillon
2016-07-05  6:13   ` Maxime Ripard
2016-07-06 22:22   ` Michael Turquette
2016-07-04 21:12 ` [PATCH 09/10] clk: tegra: make clk-tegra124-dfll-fcpu " Paul Gortmaker
2016-11-04 20:33   ` Stephen Boyd
2016-07-04 21:12 ` [PATCH 10/10] clk: ti: make clk-dra7-atl " Paul Gortmaker
2016-11-04 20:35   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).