staging: mt29f_spinand: Use module_spi_driver
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 9 Oct 2013 11:41:37 +0000 (17:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2013 22:23:14 +0000 (15:23 -0700)
module_spi_driver removes the boilerplate code and simplifies it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Henry Pan <hspan@micron.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt29f_spinand/mt29f_spinand.c

index 8e95a57a8c4cdf930b448bbaeffb88a2af75877e..564707947598c19508a4c466fba862a3d7231eb0 100644 (file)
@@ -939,23 +939,7 @@ static struct spi_driver spinand_driver = {
        .remove         = spinand_remove,
 };
 
-/*
- * Device driver registration
- */
-static int __init spinand_init(void)
-{
-       return spi_register_driver(&spinand_driver);
-}
-
-/*
- * unregister Device driver.
- */
-static void __exit spinand_exit(void)
-{
-       spi_unregister_driver(&spinand_driver);
-}
-module_init(spinand_init);
-module_exit(spinand_exit);
+module_spi_driver(spinand_driver);
 
 MODULE_DESCRIPTION("SPI NAND driver for Micron");
 MODULE_AUTHOR("Henry Pan <hspan@micron.com>, Kamlakant Patel <kamlakant.patel@broadcom.com>");