Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436601 > unrolled thread

[PATCH 00/10] clk: fix/remove module usage in non-modular code

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-07-04 23:20 +0200
Last post2016-07-07 00:30 +0200
Articles 19 — 8 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/10] clk: fix/remove module usage in non-modular code Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
    [PATCH 03/10] clk: mvebu: make cp110-system-controller explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
    [PATCH 02/10] clk: meson: make gxbb explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
      Re: [PATCH 02/10] clk: meson: make gxbb explicitly non-modular Michael Turquette <mturquette@baylibre.com> - 2016-07-07 00:30 +0200
    [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
      Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly  non-modular Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-07-05 11:10 +0200
        Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly  non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-05 15:40 +0200
      Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular Geert Uytterhoeven <geert@linux-m68k.org> - 2016-07-05 13:10 +0200
        Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly  non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-05 15:20 +0200
      Re: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly  non-modular Sylwester Nawrocki <s.nawrocki@samsung.com> - 2016-07-07 15:20 +0200
    [PATCH 01/10] clk: meson8b: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
      Re: [PATCH 01/10] clk: meson8b: make it explicitly non-modular Michael Turquette <mturquette@baylibre.com> - 2016-07-07 00:30 +0200
    [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
      Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-07-04 23:40 +0200
      Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-07-05 08:20 +0200
      Re: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular Michael Turquette <mturquette@baylibre.com> - 2016-07-07 00:30 +0200
    [PATCH 05/10] clk: oxnas: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-04 23:20 +0200
      Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular Neil Armstrong <narmstrong@baylibre.com> - 2016-07-06 15:20 +0200
      Re: [PATCH 05/10] clk: oxnas: make it explicitly non-modular Michael Turquette <mturquette@baylibre.com> - 2016-07-07 00:30 +0200

#1436601 — [PATCH 00/10] clk: fix/remove module usage in non-modular code

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 00/10] clk: fix/remove module usage in non-modular code
Message-ID<rRjrz-2ik-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


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

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 03/10] clk: mvebu: make cp110-system-controller explicitly non-modular
Message-ID<rRjrz-2ik-25@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


#1436603 — [PATCH 02/10] clk: meson: make gxbb explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 02/10] clk: meson: make gxbb explicitly non-modular
Message-ID<rRjrz-2ik-1@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


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

FromMichael Turquette <mturquette@baylibre.com>
Date2016-07-07 00:30 +0200
SubjectRe: [PATCH 02/10] clk: meson: make gxbb explicitly non-modular
Message-ID<rS3uq-6IW-11@gated-at.bofh.it>
In reply to#1436603
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_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
> 

[toc] | [prev] | [next] | [standalone]


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

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rRjrz-2ik-7@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


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

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2016-07-05 11:10 +0200
SubjectRe: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rRuwG-MJ-17@gated-at.bofh.it>
In reply to#1436604
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

[toc] | [prev] | [next] | [standalone]


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

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-05 15:40 +0200
SubjectRe: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rRyJY-3nN-25@gated-at.bofh.it>
In reply to#1436855
[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
> 

[toc] | [prev] | [next] | [standalone]


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

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-07-05 13:10 +0200
SubjectRe: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rRwoN-21i-3@gated-at.bofh.it>
In reply to#1436604
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

[toc] | [prev] | [next] | [standalone]


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

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-05 15:20 +0200
SubjectRe: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rRyqD-3hh-69@gated-at.bofh.it>
In reply to#1436922
[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

[toc] | [prev] | [next] | [standalone]


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

FromSylwester Nawrocki <s.nawrocki@samsung.com>
Date2016-07-07 15:20 +0200
SubjectRe: [PATCH 06/10] clk: samsung make clk-exynos-audss explicitly non-modular
Message-ID<rShnH-7n8-11@gated-at.bofh.it>
In reply to#1436604
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.

[toc] | [prev] | [next] | [standalone]


#1436605 — [PATCH 01/10] clk: meson8b: make it explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 01/10] clk: meson8b: make it explicitly non-modular
Message-ID<rRjrz-2ik-11@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


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

FromMichael Turquette <mturquette@baylibre.com>
Date2016-07-07 00:30 +0200
SubjectRe: [PATCH 01/10] clk: meson8b: make it explicitly non-modular
Message-ID<rS3up-6IW-3@gated-at.bofh.it>
In reply to#1436605
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_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
> 

[toc] | [prev] | [next] | [standalone]


#1436606 — [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
Message-ID<rRjrz-2ik-13@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


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

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-07-04 23:40 +0200
SubjectRe: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
Message-ID<rRjKV-2pT-17@gated-at.bofh.it>
In reply to#1436606
On Mon, 4 Jul 2016 17:12:18 -0400
Paul Gortmaker <paul.gortmaker@windriver.com> 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>

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

> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: "Emilio López" <emilio@elopez.com.ar>
> Cc: 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);

[toc] | [prev] | [next] | [standalone]


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

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-07-05 08:20 +0200
SubjectRe: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
Message-ID<rRrS9-7vt-19@gated-at.bofh.it>
In reply to#1436606

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [next] | [standalone]


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

FromMichael Turquette <mturquette@baylibre.com>
Date2016-07-07 00:30 +0200
SubjectRe: [PATCH 08/10] clk: sunxi: make clk-* explicitly non-modular
Message-ID<rS3uq-6IW-29@gated-at.bofh.it>
In reply to#1436606
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ó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>

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

[toc] | [prev] | [next] | [standalone]


#1436607 — [PATCH 05/10] clk: oxnas: make it explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-04 23:20 +0200
Subject[PATCH 05/10] clk: oxnas: make it explicitly non-modular
Message-ID<rRjrz-2ik-17@gated-at.bofh.it>
In reply to#1436601
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

[toc] | [prev] | [next] | [standalone]


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

FromNeil Armstrong <narmstrong@baylibre.com>
Date2016-07-06 15:20 +0200
SubjectRe: [PATCH 05/10] clk: oxnas: make it explicitly non-modular
Message-ID<rRUU9-1e4-7@gated-at.bofh.it>
In reply to#1436607
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>

[toc] | [prev] | [next] | [standalone]


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

FromMichael Turquette <mturquette@baylibre.com>
Date2016-07-07 00:30 +0200
SubjectRe: [PATCH 05/10] clk: oxnas: make it explicitly non-modular
Message-ID<rS3up-6IW-5@gated-at.bofh.it>
In reply to#1436607
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_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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web