Skip to content

Commit

Permalink
mtd: convert drivers/mtd/* to use module_spi_driver()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
AxelLin authored and David Woodhouse committed Mar 26, 2012
1 parent df69862 commit c9d1b75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
16 changes: 1 addition & 15 deletions drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 1 addition & 12 deletions drivers/mtd/devices/mtd_dataflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 1 addition & 12 deletions drivers/mtd/devices/sst25l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>, "
Expand Down

0 comments on commit c9d1b75

Please sign in to comment.