linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it
@ 2021-03-03  9:16 Andy Shevchenko
  2021-03-03  9:16 ` [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-03-03  9:16 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, Sudip Mukherjee,
	Mauro Carvalho Chehab, linux-spi, linux-kernel
  Cc: Greg Kroah-Hartman

Introduce module_parport_driver() and use it.
Greg or Mark, since we have this series tagged, can somebody of you pick it up?

Changelog v3:
- added tag on patch 1 (Sudip)
- Cc'ed to Greg

Andy Shevchenko (3):
  parport: Introduce module_parport_driver() helper macro
  spi: butterfly: Switch to use module_parport_driver()
  spi: lm70llp: Switch to use module_parport_driver()

 drivers/spi/spi-butterfly.c | 13 +------------
 drivers/spi/spi-lm70llp.c   | 13 +------------
 include/linux/parport.h     | 12 +++++++++++-
 3 files changed, 13 insertions(+), 25 deletions(-)

-- 
2.30.1


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

* [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro
  2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
@ 2021-03-03  9:16 ` Andy Shevchenko
  2021-03-04  8:26   ` Greg Kroah-Hartman
  2021-03-03  9:16 ` [PATCH v3 2/3] spi: butterfly: Switch to use module_parport_driver() Andy Shevchenko
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-03-03  9:16 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, Sudip Mukherjee,
	Mauro Carvalho Chehab, linux-spi, linux-kernel
  Cc: Greg Kroah-Hartman

Introduce module_parport_driver() helper macro to reduce boilerplate
in the existing and new code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 include/linux/parport.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/parport.h b/include/linux/parport.h
index f981f794c850..1c16ffb8b908 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -332,9 +332,19 @@ int __must_check __parport_register_driver(struct parport_driver *,
 	__parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
 
 /* Unregister a high-level driver. */
-extern void parport_unregister_driver (struct parport_driver *);
 void parport_unregister_driver(struct parport_driver *);
 
+/**
+ * module_parport_driver() - Helper macro for registering a modular parport driver
+ * @__parport_driver: struct parport_driver to be used
+ *
+ * Helper macro for parport drivers which do not do anything special in module
+ * init and exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit().
+ */
+#define module_parport_driver(__parport_driver) \
+	module_driver(__parport_driver, parport_register_driver, parport_unregister_driver)
+
 /* If parport_register_driver doesn't fit your needs, perhaps
  * parport_find_xxx does. */
 extern struct parport *parport_find_number (int);
-- 
2.30.1


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

* [PATCH v3 2/3] spi: butterfly: Switch to use module_parport_driver()
  2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
  2021-03-03  9:16 ` [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro Andy Shevchenko
@ 2021-03-03  9:16 ` Andy Shevchenko
  2021-03-03  9:16 ` [PATCH v3 3/3] spi: lm70llp: " Andy Shevchenko
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-03-03  9:16 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, Sudip Mukherjee,
	Mauro Carvalho Chehab, linux-spi, linux-kernel
  Cc: Greg Kroah-Hartman

Switch to use module_parport_driver() to reduce boilerplate code.
Note, device_initcall() is a default for module_init().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-butterfly.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/spi/spi-butterfly.c b/drivers/spi/spi-butterfly.c
index 7e71a351f3b7..cceae816cebc 100644
--- a/drivers/spi/spi-butterfly.c
+++ b/drivers/spi/spi-butterfly.c
@@ -317,18 +317,7 @@ static struct parport_driver butterfly_driver = {
 	.detach =	butterfly_detach,
 	.devmodel = true,
 };
-
-static int __init butterfly_init(void)
-{
-	return parport_register_driver(&butterfly_driver);
-}
-device_initcall(butterfly_init);
-
-static void __exit butterfly_exit(void)
-{
-	parport_unregister_driver(&butterfly_driver);
-}
-module_exit(butterfly_exit);
+module_parport_driver(butterfly_driver);
 
 MODULE_DESCRIPTION("Parport Adapter driver for AVR Butterfly");
 MODULE_LICENSE("GPL");
-- 
2.30.1


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

* [PATCH v3 3/3] spi: lm70llp: Switch to use module_parport_driver()
  2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
  2021-03-03  9:16 ` [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro Andy Shevchenko
  2021-03-03  9:16 ` [PATCH v3 2/3] spi: butterfly: Switch to use module_parport_driver() Andy Shevchenko
@ 2021-03-03  9:16 ` Andy Shevchenko
  2021-03-03 20:24 ` [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Mark Brown
  2021-03-04 15:05 ` Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-03-03  9:16 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, Sudip Mukherjee,
	Mauro Carvalho Chehab, linux-spi, linux-kernel
  Cc: Greg Kroah-Hartman

Switch to use module_parport_driver() to reduce boilerplate code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-lm70llp.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 174dba29b1dd..f914b8d2043e 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -320,18 +320,7 @@ static struct parport_driver spi_lm70llp_drv = {
 	.detach =	spi_lm70llp_detach,
 	.devmodel =	true,
 };
-
-static int __init init_spi_lm70llp(void)
-{
-	return parport_register_driver(&spi_lm70llp_drv);
-}
-module_init(init_spi_lm70llp);
-
-static void __exit cleanup_spi_lm70llp(void)
-{
-	parport_unregister_driver(&spi_lm70llp_drv);
-}
-module_exit(cleanup_spi_lm70llp);
+module_parport_driver(spi_lm70llp_drv);
 
 MODULE_AUTHOR("Kaiwan N Billimoria <kaiwan@designergraphix.com>");
 MODULE_DESCRIPTION(
-- 
2.30.1


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

* Re: [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it
  2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
                   ` (2 preceding siblings ...)
  2021-03-03  9:16 ` [PATCH v3 3/3] spi: lm70llp: " Andy Shevchenko
@ 2021-03-03 20:24 ` Mark Brown
  2021-03-04  8:27   ` Greg Kroah-Hartman
  2021-03-04 15:05 ` Mark Brown
  4 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2021-03-03 20:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Sudip Mukherjee, Mauro Carvalho Chehab, linux-spi, linux-kernel,
	Greg Kroah-Hartman

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

On Wed, Mar 03, 2021 at 11:16:39AM +0200, Andy Shevchenko wrote:
> Introduce module_parport_driver() and use it.
> Greg or Mark, since we have this series tagged, can somebody of you pick it up?

Greg, are you OK with me applying this?

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

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

* Re: [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro
  2021-03-03  9:16 ` [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro Andy Shevchenko
@ 2021-03-04  8:26   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-04  8:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Mark Brown, Sudip Mukherjee, Mauro Carvalho Chehab, linux-spi,
	linux-kernel

On Wed, Mar 03, 2021 at 11:16:40AM +0200, Andy Shevchenko wrote:
> Introduce module_parport_driver() helper macro to reduce boilerplate
> in the existing and new code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
>  include/linux/parport.h | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it
  2021-03-03 20:24 ` [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Mark Brown
@ 2021-03-04  8:27   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-04  8:27 UTC (permalink / raw)
  To: Mark Brown
  Cc: Andy Shevchenko, Sudip Mukherjee, Mauro Carvalho Chehab,
	linux-spi, linux-kernel

On Wed, Mar 03, 2021 at 08:24:32PM +0000, Mark Brown wrote:
> On Wed, Mar 03, 2021 at 11:16:39AM +0200, Andy Shevchenko wrote:
> > Introduce module_parport_driver() and use it.
> > Greg or Mark, since we have this series tagged, can somebody of you pick it up?
> 
> Greg, are you OK with me applying this?

Yup, just sent a reviewed-by for it, thanks.

greg k-h

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

* Re: [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it
  2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
                   ` (3 preceding siblings ...)
  2021-03-03 20:24 ` [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Mark Brown
@ 2021-03-04 15:05 ` Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2021-03-04 15:05 UTC (permalink / raw)
  To: linux-kernel, Andy Shevchenko, linux-spi, Mauro Carvalho Chehab,
	Sudip Mukherjee
  Cc: Greg Kroah-Hartman

On Wed, 3 Mar 2021 11:16:39 +0200, Andy Shevchenko wrote:
> Introduce module_parport_driver() and use it.
> Greg or Mark, since we have this series tagged, can somebody of you pick it up?
> 
> Changelog v3:
> - added tag on patch 1 (Sudip)
> - Cc'ed to Greg
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] parport: Introduce module_parport_driver() helper macro
      commit: 9c9b536e1ee94558f1ae5ed8d13b76295b2dfef4
[2/3] spi: butterfly: Switch to use module_parport_driver()
      commit: ef3a5316f41fa027cb00b158324a5ef7e3d1a277
[3/3] spi: lm70llp: Switch to use module_parport_driver()
      commit: 7ea6fd9ba47853fb9e88b18d34fc60c71a3fd070

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2021-03-04 15:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  9:16 [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Andy Shevchenko
2021-03-03  9:16 ` [PATCH v3 1/3] parport: Introduce module_parport_driver() helper macro Andy Shevchenko
2021-03-04  8:26   ` Greg Kroah-Hartman
2021-03-03  9:16 ` [PATCH v3 2/3] spi: butterfly: Switch to use module_parport_driver() Andy Shevchenko
2021-03-03  9:16 ` [PATCH v3 3/3] spi: lm70llp: " Andy Shevchenko
2021-03-03 20:24 ` [PATCH v3 0/3] parport: Introduce module_parport_driver() and use it Mark Brown
2021-03-04  8:27   ` Greg Kroah-Hartman
2021-03-04 15:05 ` Mark Brown

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