Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Ryan Mallon <rmallon@gmail.com>,
	Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>,
	Andre Renaud <andre@bluewatersys.com>,
	Mike Lavender <mike@steroidmicros.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Andrew Victor <linux@maxim.org.za>
Subject: [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver()
Date: Fri, 27 Jan 2012 15:45:20 +0800	[thread overview]
Message-ID: <1327650320.3758.5.camel@phoenix> (raw)

This patch converts the drivers in drivers/mtd/* to use the
module_spi_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Mike Lavender <mike@steroidmicros.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Andre Renaud <andre@bluewatersys.com>
Cc: Ryan Mallon <rmallon@gmail.com>
---
 drivers/mtd/devices/m25p80.c        |   16 +---------------
 drivers/mtd/devices/mtd_dataflash.c |   13 +------------
 drivers/mtd/devices/sst25l.c        |   13 +------------
 3 files changed, 3 insertions(+), 39 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7c60ddd..230b02e 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -1004,21 +1004,7 @@ static struct spi_driver m25p80_driver = {
 	 */
 };
 
-
-static int __init m25p80_init(void)
-{
-	return spi_register_driver(&m25p80_driver);
-}
-
-
-static void __exit m25p80_exit(void)
-{
-	spi_unregister_driver(&m25p80_driver);
-}
-
-
-module_init(m25p80_init);
-module_exit(m25p80_exit);
+module_spi_driver(m25p80_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mike Lavender");
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 236057e..5ec5fc9 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -946,18 +946,7 @@ static struct spi_driver dataflash_driver = {
 	/* FIXME:  investigate suspend and resume... */
 };
 
-static int __init dataflash_init(void)
-{
-	return spi_register_driver(&dataflash_driver);
-}
-module_init(dataflash_init);
-
-static void __exit dataflash_exit(void)
-{
-	spi_unregister_driver(&dataflash_driver);
-}
-module_exit(dataflash_exit);
-
+module_spi_driver(dataflash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Andrew Victor, David Brownell");
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index 5fc1983..196fd95 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -450,18 +450,7 @@ static struct spi_driver sst25l_driver = {
 	.remove		= __devexit_p(sst25l_remove),
 };
 
-static int __init sst25l_init(void)
-{
-	return spi_register_driver(&sst25l_driver);
-}
-
-static void __exit sst25l_exit(void)
-{
-	spi_unregister_driver(&sst25l_driver);
-}
-
-module_init(sst25l_init);
-module_exit(sst25l_exit);
+module_spi_driver(sst25l_driver);
 
 MODULE_DESCRIPTION("MTD SPI driver for SST25L Flash chips");
 MODULE_AUTHOR("Andre Renaud <andre@bluewatersys.com>, "
-- 
1.7.5.4

             reply	other threads:[~2012-01-27  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  7:45 Axel Lin [this message]
2012-01-27  8:23 ` [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver() Ryan Mallon
2012-01-27 15:03 ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327650320.3758.5.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=Artem.Bityutskiy@linux.intel.com \
    --cc=andre@bluewatersys.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@maxim.org.za \
    --cc=mike@steroidmicros.com \
    --cc=rmallon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox