1 From f94454615da63008ac865e6a7b03bbe79041e8c2 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 20 Feb 2012 12:15:25 +0100
4 Subject: [PATCH 45/70] MTD: MIPS: lantiq: use module_platform_driver inside
7 Reduce boilerplate code by converting driver to module_platform_driver.
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Cc: linux-mtd@lists.infradead.org
12 drivers/mtd/maps/lantiq-flash.c | 22 +++-------------------
13 1 files changed, 3 insertions(+), 19 deletions(-)
15 diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
16 index 764d468..b55212c 100644
17 --- a/drivers/mtd/maps/lantiq-flash.c
18 +++ b/drivers/mtd/maps/lantiq-flash.c
19 @@ -108,7 +108,7 @@ ltq_copy_to(struct map_info *map, unsigned long to,
20 spin_unlock_irqrestore(&ebu_lock, flags);
25 ltq_mtd_probe(struct platform_device *pdev)
27 struct physmap_flash_data *ltq_mtd_data = dev_get_platdata(&pdev->dev);
28 @@ -208,6 +208,7 @@ ltq_mtd_remove(struct platform_device *pdev)
31 static struct platform_driver ltq_mtd_driver = {
32 + .probe = ltq_mtd_probe,
33 .remove = __devexit_p(ltq_mtd_remove),
36 @@ -215,24 +216,7 @@ static struct platform_driver ltq_mtd_driver = {
43 - int ret = platform_driver_probe(<q_mtd_driver, ltq_mtd_probe);
46 - pr_err("ltq_nor: error registering platform driver");
53 - platform_driver_unregister(<q_mtd_driver);
56 -module_init(init_ltq_mtd);
57 -module_exit(exit_ltq_mtd);
58 +module_platform_driver(ltq_mtd_driver);
60 MODULE_LICENSE("GPL");
61 MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");