adds 3.3 patches and files
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.3 / 0041-MTD-MIPS-lantiq-use-module_platform_driver-inside-la.patch
1 From 94ca79b8bd9bf8ec5dcd993e0f004056f12f16f4 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 41/70] MTD: MIPS: lantiq: use module_platform_driver inside
5 lantiq map driver
6
7 Reduce boilerplate code by converting driver to module_platform_driver.
8
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Cc: linux-mtd@lists.infradead.org
11 ---
12 drivers/mtd/maps/lantiq-flash.c | 22 +++-------------------
13 1 files changed, 3 insertions(+), 19 deletions(-)
14
15 diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
16 index cf7a3cd..ccc6954 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);
21 }
22
23 -static int __init
24 +static int __devinit
25 ltq_mtd_probe(struct platform_device *pdev)
26 {
27 struct physmap_flash_data *ltq_mtd_data = dev_get_platdata(&pdev->dev);
28 @@ -204,6 +204,7 @@ ltq_mtd_remove(struct platform_device *pdev)
29 }
30
31 static struct platform_driver ltq_mtd_driver = {
32 + .probe = ltq_mtd_probe,
33 .remove = __devexit_p(ltq_mtd_remove),
34 .driver = {
35 .name = "ltq_nor",
36 @@ -211,24 +212,7 @@ static struct platform_driver ltq_mtd_driver = {
37 },
38 };
39
40 -static int __init
41 -init_ltq_mtd(void)
42 -{
43 - int ret = platform_driver_probe(&ltq_mtd_driver, ltq_mtd_probe);
44 -
45 - if (ret)
46 - pr_err("ltq_nor: error registering platform driver");
47 - return ret;
48 -}
49 -
50 -static void __exit
51 -exit_ltq_mtd(void)
52 -{
53 - platform_driver_unregister(&ltq_mtd_driver);
54 -}
55 -
56 -module_init(init_ltq_mtd);
57 -module_exit(exit_ltq_mtd);
58 +module_platform_driver(ltq_mtd_driver);
59
60 MODULE_LICENSE("GPL");
61 MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
62 --
63 1.7.9.1
64