* [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver()
@ 2012-01-27 7:45 Axel Lin
2012-01-27 8:23 ` Ryan Mallon
2012-01-27 15:03 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-01-27 7:45 UTC (permalink / raw)
To: linux-mtd
Cc: Ryan Mallon, Artem Bityutskiy, Andre Renaud, Mike Lavender,
David Woodhouse, Andrew Victor
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver()
2012-01-27 7:45 [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver() Axel Lin
@ 2012-01-27 8:23 ` Ryan Mallon
2012-01-27 15:03 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Ryan Mallon @ 2012-01-27 8:23 UTC (permalink / raw)
To: Axel Lin
Cc: Artem Bityutskiy, Andre Renaud, linux-mtd, Mike Lavender,
David Woodhouse, Andrew Victor
On 27/01/12 18:45, Axel Lin wrote:
> 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(-)
For sst25l:
Acked-by: Ryan Mallon <rmallon@gmail.com>
> 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>, "
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver()
2012-01-27 7:45 [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver() Axel Lin
2012-01-27 8:23 ` Ryan Mallon
@ 2012-01-27 15:03 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2012-01-27 15:03 UTC (permalink / raw)
To: Axel Lin
Cc: Ryan Mallon, Andre Renaud, linux-mtd, Mike Lavender,
David Woodhouse, Andrew Victor
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
On Fri, 2012-01-27 at 15:45 +0800, Axel Lin wrote:
> This patch converts the drivers in drivers/mtd/* to use the
> module_spi_driver() macro which makes the code smaller and a bit simpler.
Pushed to l2-mtd.git, thanks!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-27 15:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27 7:45 [PATCH] mtd: convert drivers/mtd/* to use module_spi_driver() Axel Lin
2012-01-27 8:23 ` Ryan Mallon
2012-01-27 15:03 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox