[tools/mklibs] add missing includes ('unistd.h') for mklibs
[openwrt.git] / target / linux / lantiq / patches-3.2 / 0045-MTD-MIPS-lantiq-use-module_platform_driver-inside-la.patch
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
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 --- a/drivers/mtd/maps/lantiq-flash.c
16 +++ b/drivers/mtd/maps/lantiq-flash.c
17 @@ -108,7 +108,7 @@ ltq_copy_to(struct map_info *map, unsign
18         spin_unlock_irqrestore(&ebu_lock, flags);
19  }
20  
21 -static int __init
22 +static int __devinit
23  ltq_mtd_probe(struct platform_device *pdev)
24  {
25         struct physmap_flash_data *ltq_mtd_data = dev_get_platdata(&pdev->dev);
26 @@ -208,6 +208,7 @@ ltq_mtd_remove(struct platform_device *p
27  }
28  
29  static struct platform_driver ltq_mtd_driver = {
30 +       .probe = ltq_mtd_probe,
31         .remove = __devexit_p(ltq_mtd_remove),
32         .driver = {
33                 .name = "ltq_nor",
34 @@ -215,24 +216,7 @@ static struct platform_driver ltq_mtd_dr
35         },
36  };
37  
38 -static int __init
39 -init_ltq_mtd(void)
40 -{
41 -       int ret = platform_driver_probe(&ltq_mtd_driver, ltq_mtd_probe);
42 -
43 -       if (ret)
44 -               pr_err("ltq_nor: error registering platform driver");
45 -       return ret;
46 -}
47 -
48 -static void __exit
49 -exit_ltq_mtd(void)
50 -{
51 -       platform_driver_unregister(&ltq_mtd_driver);
52 -}
53 -
54 -module_init(init_ltq_mtd);
55 -module_exit(exit_ltq_mtd);
56 +module_platform_driver(ltq_mtd_driver);
57  
58  MODULE_LICENSE("GPL");
59  MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");