Root/target/linux/lantiq/patches-3.3/0010-watchdog-support.patch

1From 8b0fb3cc6548fa4b531a26a605a0e213962bb889 Mon Sep 17 00:00:00 2001
2From: John Crispin <blogic@openwrt.org>
3Date: Fri, 3 Aug 2012 09:54:14 +0200
4Subject: [PATCH 10/25] watchdog support
5
6---
7 drivers/watchdog/lantiq_wdt.c | 23 +++++------------------
8 1 files changed, 5 insertions(+), 18 deletions(-)
9
10diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c
11index d3a63be..70127b3 100644
12--- a/drivers/watchdog/lantiq_wdt.c
13+++ b/drivers/watchdog/lantiq_wdt.c
14@@ -16,7 +16,7 @@
15 #include <linux/clk.h>
16 #include <linux/io.h>
17 
18-#include <lantiq.h>
19+#include <lantiq_soc.h>
20 
21 /* Section 3.4 of the datasheet
22  * The password sequence protects the WDT control register from unintended
23@@ -182,7 +182,7 @@ static struct miscdevice ltq_wdt_miscdev = {
24     .fops = &ltq_wdt_fops,
25 };
26 
27-static int __init
28+static int __devinit
29 ltq_wdt_probe(struct platform_device *pdev)
30 {
31     struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
32@@ -206,7 +206,7 @@ ltq_wdt_probe(struct platform_device *pdev)
33     }
34 
35     /* we do not need to enable the clock as it is always running */
36- clk = clk_get(&pdev->dev, "io");
37+ clk = clk_get_io();
38     WARN_ON(!clk);
39     ltq_io_region_clk_rate = clk_get_rate(clk);
40     clk_put(clk);
41@@ -227,6 +227,7 @@ ltq_wdt_remove(struct platform_device *pdev)
42 
43 
44 static struct platform_driver ltq_wdt_driver = {
45+ .probe = ltq_wdt_probe,
46     .remove = __devexit_p(ltq_wdt_remove),
47     .driver = {
48         .name = "ltq_wdt",
49@@ -234,21 +235,7 @@ static struct platform_driver ltq_wdt_driver = {
50     },
51 };
52 
53-static int __init
54-init_ltq_wdt(void)
55-{
56- return platform_driver_probe(&ltq_wdt_driver, ltq_wdt_probe);
57-}
58-
59-static void __exit
60-exit_ltq_wdt(void)
61-{
62- return platform_driver_unregister(&ltq_wdt_driver);
63-}
64-
65-module_init(init_ltq_wdt);
66-module_exit(exit_ltq_wdt);
67-
68+module_platform_driver(ltq_wdt_driver);
69 module_param(nowayout, int, 0);
70 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
71 
72--
731.7.9.1
74
75

Archive Download this file



interactive