brcm47xx: update watchdog driver
[openwrt.git] / target / linux / brcm47xx / patches-3.6 / 542-watchdog-bcm47xx_wdt.c-rename-ops-methods.patch
1 --- a/drivers/watchdog/bcm47xx_wdt.c
2 +++ b/drivers/watchdog/bcm47xx_wdt.c
3 @@ -46,12 +46,13 @@ MODULE_PARM_DESC(nowayout,
4                                 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
5  #endif
6  
7 +
8  static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd)
9  {
10         return container_of(wdd, struct bcm47xx_wdt, wdd);
11  }
12  
13 -static void bcm47xx_timer_tick(unsigned long data)
14 +static void bcm47xx_wdt_soft_timer_tick(unsigned long data)
15  {
16         struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data;
17         u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms);
18 @@ -64,7 +65,7 @@ static void bcm47xx_timer_tick(unsigned
19         }
20  }
21  
22 -static int bcm47xx_wdt_keepalive(struct watchdog_device *wdd)
23 +static int bcm47xx_wdt_soft_keepalive(struct watchdog_device *wdd)
24  {
25         struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
26  
27 @@ -73,17 +74,17 @@ static int bcm47xx_wdt_keepalive(struct
28         return 0;
29  }
30  
31 -static int bcm47xx_wdt_start(struct watchdog_device *wdd)
32 +static int bcm47xx_wdt_soft_start(struct watchdog_device *wdd)
33  {
34         struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
35  
36 -       bcm47xx_wdt_keepalive(wdd);
37 -       bcm47xx_timer_tick((unsigned long)wdt);
38 +       bcm47xx_wdt_soft_keepalive(wdd);
39 +       bcm47xx_wdt_soft_timer_tick((unsigned long)wdt);
40  
41         return 0;
42  }
43  
44 -static int bcm47xx_wdt_stop(struct watchdog_device *wdd)
45 +static int bcm47xx_wdt_soft_stop(struct watchdog_device *wdd)
46  {
47         struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
48  
49 @@ -93,8 +94,8 @@ static int bcm47xx_wdt_stop(struct watch
50         return 0;
51  }
52  
53 -static int bcm47xx_wdt_set_timeout(struct watchdog_device *wdd,
54 -                                  unsigned int new_time)
55 +static int bcm47xx_wdt_soft_set_timeout(struct watchdog_device *wdd,
56 +                                       unsigned int new_time)
57  {
58         if (new_time < 1 || new_time > WDT_MAX_TIME) {
59                 pr_warn("timeout value must be 1<=x<=%d, using %d\n",
60 @@ -124,12 +125,12 @@ static int bcm47xx_wdt_notify_sys(struct
61         return NOTIFY_DONE;
62  }
63  
64 -static struct watchdog_ops bcm47xx_wdt_ops = {
65 +static struct watchdog_ops bcm47xx_wdt_soft_ops = {
66         .owner          = THIS_MODULE,
67 -       .start          = bcm47xx_wdt_start,
68 -       .stop           = bcm47xx_wdt_stop,
69 -       .ping           = bcm47xx_wdt_keepalive,
70 -       .set_timeout    = bcm47xx_wdt_set_timeout,
71 +       .start          = bcm47xx_wdt_soft_start,
72 +       .stop           = bcm47xx_wdt_soft_stop,
73 +       .ping           = bcm47xx_wdt_soft_keepalive,
74 +       .set_timeout    = bcm47xx_wdt_soft_set_timeout,
75  };
76  
77  static int __devinit bcm47xx_wdt_probe(struct platform_device *pdev)
78 @@ -140,10 +141,10 @@ static int __devinit bcm47xx_wdt_probe(s
79         if (!wdt)
80                 return -ENXIO;
81  
82 -       setup_timer(&wdt->soft_timer, bcm47xx_timer_tick,
83 +       setup_timer(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick,
84                     (long unsigned int)wdt);
85  
86 -       wdt->wdd.ops = &bcm47xx_wdt_ops;
87 +       wdt->wdd.ops = &bcm47xx_wdt_soft_ops;
88         wdt->wdd.info = &bcm47xx_wdt_info;
89         wdt->wdd.timeout = WDT_DEFAULT_TIME;
90         ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout);