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


Groups > linux.kernel > #1288035 > unrolled thread

[PATCH 5/6] drivers/dma: make sh/shdma-*.c explicitly non-modular

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2015-12-10 00:30 +0100
Last post2015-12-10 10:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/6] drivers/dma: make sh/shdma-*.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-12-10 00:30 +0100
    Re: [PATCH 5/6] drivers/dma: make sh/shdma-*.c explicitly non-modular Geert Uytterhoeven <geert@linux-m68k.org> - 2015-12-10 10:50 +0100

#1288035 — [PATCH 5/6] drivers/dma: make sh/shdma-*.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2015-12-10 00:30 +0100
Subject[PATCH 5/6] drivers/dma: make sh/shdma-*.c explicitly non-modular
Message-ID<qDWlk-6vk-23@gated-at.bofh.it>
The Kconfig currently controlling compilation of these files is:

config SH_DMAE_BASE
     bool "Renesas SuperH DMA Engine support"

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

In one file, we explicitly disallow a driver unbind, since that
doesn't have a sensible use case anyway, and there was not a
".remove" code assigned in the struct for it either.

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

Similarly builtin_platform_driver and module_platform_driver use
device_initcall, so the init ordering remains unchanged there too.

In one file, We replace module.h with moduleparam.h since the file does
have one module_param already.

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: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/dma/sh/shdma-base.c | 14 ++------------
 drivers/dma/sh/shdma-of.c   | 11 +++--------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
index 10fcabad80f3..69097a860fc8 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -18,7 +18,7 @@
 #include <linux/dmaengine.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -1051,14 +1051,4 @@ static int __init shdma_enter(void)
 		return -ENOMEM;
 	return 0;
 }
-module_init(shdma_enter);
-
-static void __exit shdma_exit(void)
-{
-	kfree(shdma_slave_used);
-}
-module_exit(shdma_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SH-DMA driver base library");
-MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
+device_initcall(shdma_enter);
diff --git a/drivers/dma/sh/shdma-of.c b/drivers/dma/sh/shdma-of.c
index f999f9b0d314..888bd8761333 100644
--- a/drivers/dma/sh/shdma-of.c
+++ b/drivers/dma/sh/shdma-of.c
@@ -10,7 +10,7 @@
  */
 
 #include <linux/dmaengine.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_dma.h>
 #include <linux/of_platform.h>
@@ -62,18 +62,13 @@ static const struct of_device_id shdma_of_match[] = {
 	{ .compatible = "renesas,shdma-mux", },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, sh_dmae_of_match);
 
 static struct platform_driver shdma_of = {
 	.driver		= {
 		.name	= "shdma-of",
+		.suppress_bind_attrs = true,
 		.of_match_table = shdma_of_match,
 	},
 	.probe		= shdma_of_probe,
 };
-
-module_platform_driver(shdma_of);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SH-DMA driver DT glue");
-MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
+builtin_platform_driver(shdma_of);
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1288402

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2015-12-10 10:50 +0100
Message-ID<qE61j-4pU-3@gated-at.bofh.it>
In reply to#1288035
CC linux-sh

On Thu, Dec 10, 2015 at 12:22 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of these files is:
>
> config SH_DMAE_BASE
>      bool "Renesas SuperH DMA Engine support"
>
> ...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.
>
> In one file, we explicitly disallow a driver unbind, since that
> doesn't have a sensible use case anyway, and there was not a
> ".remove" code assigned in the struct for it either.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
>
> Similarly builtin_platform_driver and module_platform_driver use
> device_initcall, so the init ordering remains unchanged there too.
>
> In one file, We replace module.h with moduleparam.h since the file does
> have one module_param already.
>
> 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: Vinod Koul <vinod.koul@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: dmaengine@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/dma/sh/shdma-base.c | 14 ++------------
>  drivers/dma/sh/shdma-of.c   | 11 +++--------
>  2 files changed, 5 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
> index 10fcabad80f3..69097a860fc8 100644
> --- a/drivers/dma/sh/shdma-base.c
> +++ b/drivers/dma/sh/shdma-base.c
> @@ -18,7 +18,7 @@
>  #include <linux/dmaengine.h>
>  #include <linux/init.h>
>  #include <linux/interrupt.h>
> -#include <linux/module.h>
> +#include <linux/moduleparam.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/slab.h>
>  #include <linux/spinlock.h>
> @@ -1051,14 +1051,4 @@ static int __init shdma_enter(void)
>                 return -ENOMEM;
>         return 0;
>  }
> -module_init(shdma_enter);
> -
> -static void __exit shdma_exit(void)
> -{
> -       kfree(shdma_slave_used);
> -}
> -module_exit(shdma_exit);
> -
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("SH-DMA driver base library");
> -MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
> +device_initcall(shdma_enter);
> diff --git a/drivers/dma/sh/shdma-of.c b/drivers/dma/sh/shdma-of.c
> index f999f9b0d314..888bd8761333 100644
> --- a/drivers/dma/sh/shdma-of.c
> +++ b/drivers/dma/sh/shdma-of.c
> @@ -10,7 +10,7 @@
>   */
>
>  #include <linux/dmaengine.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  #include <linux/of_dma.h>
>  #include <linux/of_platform.h>
> @@ -62,18 +62,13 @@ static const struct of_device_id shdma_of_match[] = {
>         { .compatible = "renesas,shdma-mux", },
>         { }
>  };
> -MODULE_DEVICE_TABLE(of, sh_dmae_of_match);
>
>  static struct platform_driver shdma_of = {
>         .driver         = {
>                 .name   = "shdma-of",
> +               .suppress_bind_attrs = true,
>                 .of_match_table = shdma_of_match,
>         },
>         .probe          = shdma_of_probe,
>  };
> -
> -module_platform_driver(shdma_of);
> -
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("SH-DMA driver DT glue");
> -MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
> +builtin_platform_driver(shdma_of);
> --
> 2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web