[lantiq] update 3.2 patches
[openwrt.git] / target / linux / lantiq / patches-3.2 / 0045-WDT-MIPS-lantiq-use-module_platform_driver-inside-la.patch
1 From 3b8b06b76d01136fa4e195a10c5ee12b2352616e Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 20 Feb 2012 12:16:31 +0100
4 Subject: [PATCH 45/73] WDT: MIPS: lantiq: use module_platform_driver inside
5  lantiq watchdog 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-watchdog@vger.kernel.org
11 ---
12  drivers/watchdog/lantiq_wdt.c |   19 +++----------------
13  1 files changed, 3 insertions(+), 16 deletions(-)
14
15 diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c
16 index da2b09f..40c9eb7 100644
17 --- a/drivers/watchdog/lantiq_wdt.c
18 +++ b/drivers/watchdog/lantiq_wdt.c
19 @@ -182,7 +182,7 @@ static struct miscdevice ltq_wdt_miscdev = {
20         .fops   = &ltq_wdt_fops,
21  };
22  
23 -static int __init
24 +static int __devinit
25  ltq_wdt_probe(struct platform_device *pdev)
26  {
27         struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
28 @@ -230,6 +230,7 @@ ltq_wdt_remove(struct platform_device *pdev)
29  
30  
31  static struct platform_driver ltq_wdt_driver = {
32 +       .probe = ltq_wdt_probe,
33         .remove = __devexit_p(ltq_wdt_remove),
34         .driver = {
35                 .name = "ltq_wdt",
36 @@ -237,21 +238,7 @@ static struct platform_driver ltq_wdt_driver = {
37         },
38  };
39  
40 -static int __init
41 -init_ltq_wdt(void)
42 -{
43 -       return platform_driver_probe(&ltq_wdt_driver, ltq_wdt_probe);
44 -}
45 -
46 -static void __exit
47 -exit_ltq_wdt(void)
48 -{
49 -       return platform_driver_unregister(&ltq_wdt_driver);
50 -}
51 -
52 -module_init(init_ltq_wdt);
53 -module_exit(exit_ltq_wdt);
54 -
55 +module_platform_driver(ltq_wdt_driver);
56  module_param(nowayout, int, 0);
57  MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
58  
59 -- 
60 1.7.9.1
61