mtd: bcm47xxnflash: Use module_platform_driver
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 11 Oct 2013 04:41:24 +0000 (10:11 +0530)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 7 Nov 2013 07:32:56 +0000 (23:32 -0800)
module_platform_driver simplifies the code by removing boiler plate.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/bcm47xxnflash/main.c

index 7bae569fdc79880e5025a5db3e93dd34da274598..2dc3aa632f6cc0d7cbf9f70992a9732f43781b64 100644 (file)
@@ -85,22 +85,4 @@ static struct platform_driver bcm47xxnflash_driver = {
        },
 };
 
-static int __init bcm47xxnflash_init(void)
-{
-       int err;
-
-       err = platform_driver_register(&bcm47xxnflash_driver);
-       if (err)
-               pr_err("Failed to register bcm47xx nand flash driver: %d\n",
-                      err);
-
-       return err;
-}
-
-static void __exit bcm47xxnflash_exit(void)
-{
-       platform_driver_unregister(&bcm47xxnflash_driver);
-}
-
-module_init(bcm47xxnflash_init);
-module_exit(bcm47xxnflash_exit);
+module_platform_driver(bcm47xxnflash_driver);