[lantiq] adds 3.3 patches and files
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.3 / 0042-WDT-MIPS-lantiq-use-module_platform_driver-inside-la.patch
1 From 9004f152deddba21ab7b0fa3ba0b243fb5cbd5a1 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 42/70] 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 fa4866b..70127b3 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 @@ -227,6 +227,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 @@ -234,21 +235,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