2012-04-12 15:33:56 +03:00
|
|
|
From 8757ae55b11c87d75078b44384b27aadc52f2f22 Mon Sep 17 00:00:00 2001
|
2012-03-25 11:50:09 +03:00
|
|
|
From: John Crispin <blogic@openwrt.org>
|
|
|
|
Date: Mon, 20 Feb 2012 12:15:25 +0100
|
2012-04-12 15:33:56 +03:00
|
|
|
Subject: [PATCH 44/73] MTD: MIPS: lantiq: use module_platform_driver inside
|
2012-03-25 11:50:09 +03:00
|
|
|
lantiq map driver
|
|
|
|
|
|
|
|
Reduce boilerplate code by converting driver to module_platform_driver.
|
|
|
|
|
|
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
Cc: linux-mtd@lists.infradead.org
|
|
|
|
---
|
|
|
|
drivers/mtd/maps/lantiq-flash.c | 22 +++-------------------
|
|
|
|
1 files changed, 3 insertions(+), 19 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/mtd/maps/lantiq-flash.c
|
|
|
|
+++ b/drivers/mtd/maps/lantiq-flash.c
|
2012-04-17 15:50:54 +03:00
|
|
|
@@ -108,7 +108,7 @@ ltq_copy_to(struct map_info *map, unsign
|
2012-03-25 11:50:09 +03:00
|
|
|
spin_unlock_irqrestore(&ebu_lock, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int __init
|
|
|
|
+static int __devinit
|
|
|
|
ltq_mtd_probe(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
struct physmap_flash_data *ltq_mtd_data = dev_get_platdata(&pdev->dev);
|
2012-04-17 15:50:54 +03:00
|
|
|
@@ -208,6 +208,7 @@ ltq_mtd_remove(struct platform_device *p
|
2012-03-25 11:50:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver ltq_mtd_driver = {
|
|
|
|
+ .probe = ltq_mtd_probe,
|
|
|
|
.remove = __devexit_p(ltq_mtd_remove),
|
|
|
|
.driver = {
|
|
|
|
.name = "ltq_nor",
|
2012-04-17 15:50:54 +03:00
|
|
|
@@ -215,24 +216,7 @@ static struct platform_driver ltq_mtd_dr
|
2012-03-25 11:50:09 +03:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
-static int __init
|
|
|
|
-init_ltq_mtd(void)
|
|
|
|
-{
|
|
|
|
- int ret = platform_driver_probe(<q_mtd_driver, ltq_mtd_probe);
|
|
|
|
-
|
|
|
|
- if (ret)
|
|
|
|
- pr_err("ltq_nor: error registering platform driver");
|
|
|
|
- return ret;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void __exit
|
|
|
|
-exit_ltq_mtd(void)
|
|
|
|
-{
|
|
|
|
- platform_driver_unregister(<q_mtd_driver);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-module_init(init_ltq_mtd);
|
|
|
|
-module_exit(exit_ltq_mtd);
|
|
|
|
+module_platform_driver(ltq_mtd_driver);
|
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
|