Re: [PATCH] mtd: convert drivers/mtd/* to usemodule_platform_driver()

From: Jiandong Zheng
Date: Tue Nov 29 2011 - 14:51:00 EST


On 11/27/2011 4:45 AM, Axel Lin wrote:
This patch converts the drivers in drivers/mtd/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: David Woodhouse<dwmw2@xxxxxxxxxxxxx>
Cc: Jiandong Zheng<jdzheng@xxxxxxxxxxxx>
Cc: Scott Branden<sbranden@xxxxxxxxxxxx>
Cc: Wan ZongShun<mcuos.com@xxxxxxxxx>
Cc: Dmitry Eremin-Solenikov<dbaryshkov@xxxxxxxxx>
Cc: Jamie Iles<jamie@xxxxxxxxxxxxx>
Cc: Olof Johansson<olof@xxxxxxxxx>
Cc: Kyungmin Park<kyungmin.park@xxxxxxxxxxx>
Cc: Haojian Zhuang<haojian.zhuang@xxxxxxxxx>
Cc: Artem Bityutskiy<Artem.Bityutskiy@xxxxxxxxx>
Cc: Ralf Baechle<ralf@xxxxxxxxxxxxxx>
Cc: Brian Norris<computersforpeace@xxxxxxxxx>
Cc: Lars-Peter Clausen<lars@xxxxxxxxxx>
Cc: Manuel Lauss<manuel.lauss@xxxxxxxxxxxxxx>
Cc: Vimal Singh<vimal.newwork@xxxxxxxxx>
Cc: Andres Salomon<dilinger@xxxxxxxxxx>
Cc: Sukumar Ghorai<s-ghorai@xxxxxx>
Signed-off-by: Axel Lin<axel.lin@xxxxxxxxx>
---

drivers/mtd/nand/bcm_umi_nand.c | 13 +------------

diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index 46b58d6..50387fd 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -546,18 +546,7 @@ static struct platform_driver nand_driver = {
.resume = bcm_umi_nand_resume,
};

-static int __init nand_init(void)
-{
- return platform_driver_register(&nand_driver);
-}
-
-static void __exit nand_exit(void)
-{
- platform_driver_unregister(&nand_driver);
-}
-
-module_init(nand_init);
-module_exit(nand_exit);
+module_platform_driver(nand_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Broadcom");

Acked-by: Jiandong Zheng <jdzheng@xxxxxxxxxxxx>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/