aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/shwdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/shwdt.c')
-rw-r--r--drivers/watchdog/shwdt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index 824125adf90a..cdc7138be301 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -30,7 +30,7 @@
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <linux/watchdog.h> 33#include <asm/watchdog.h>
34 34
35#define PFX "shwdt: " 35#define PFX "shwdt: "
36 36
@@ -68,7 +68,7 @@ static int clock_division_ratio = WTCSR_CKS_4096;
68static void sh_wdt_ping(unsigned long data); 68static void sh_wdt_ping(unsigned long data);
69 69
70static unsigned long shwdt_is_open; 70static unsigned long shwdt_is_open;
71static struct watchdog_info sh_wdt_info; 71static const struct watchdog_info sh_wdt_info;
72static char shwdt_expect_close; 72static char shwdt_expect_close;
73static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0); 73static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0);
74static unsigned long next_heartbeat; 74static unsigned long next_heartbeat;
@@ -89,7 +89,7 @@ static void sh_wdt_start(void)
89 __u8 csr; 89 __u8 csr;
90 unsigned long flags; 90 unsigned long flags;
91 91
92 spin_lock_irqsave(&wdt_lock, flags); 92 spin_lock_irqsave(&shwdt_lock, flags);
93 93
94 next_heartbeat = jiffies + (heartbeat * HZ); 94 next_heartbeat = jiffies + (heartbeat * HZ);
95 mod_timer(&timer, next_ping_period(clock_division_ratio)); 95 mod_timer(&timer, next_ping_period(clock_division_ratio));
@@ -127,7 +127,7 @@ static void sh_wdt_start(void)
127 csr &= ~RSTCSR_RSTS; 127 csr &= ~RSTCSR_RSTS;
128 sh_wdt_write_rstcsr(csr); 128 sh_wdt_write_rstcsr(csr);
129#endif 129#endif
130 spin_unlock_irqrestore(&wdt_lock, flags); 130 spin_unlock_irqrestore(&shwdt_lock, flags);
131} 131}
132 132
133/** 133/**
@@ -139,14 +139,14 @@ static void sh_wdt_stop(void)
139 __u8 csr; 139 __u8 csr;
140 unsigned long flags; 140 unsigned long flags;
141 141
142 spin_lock_irqsave(&wdt_lock, flags); 142 spin_lock_irqsave(&shwdt_lock, flags);
143 143
144 del_timer(&timer); 144 del_timer(&timer);
145 145
146 csr = sh_wdt_read_csr(); 146 csr = sh_wdt_read_csr();
147 csr &= ~WTCSR_TME; 147 csr &= ~WTCSR_TME;
148 sh_wdt_write_csr(csr); 148 sh_wdt_write_csr(csr);
149 spin_unlock_irqrestore(&wdt_lock, flags); 149 spin_unlock_irqrestore(&shwdt_lock, flags);
150} 150}
151 151
152/** 152/**
@@ -157,9 +157,9 @@ static inline void sh_wdt_keepalive(void)
157{ 157{
158 unsigned long flags; 158 unsigned long flags;
159 159
160 spin_lock_irqsave(&wdt_lock, flags); 160 spin_lock_irqsave(&shwdt_lock, flags);
161 next_heartbeat = jiffies + (heartbeat * HZ); 161 next_heartbeat = jiffies + (heartbeat * HZ);
162 spin_unlock_irqrestore(&wdt_lock, flags); 162 spin_unlock_irqrestore(&shwdt_lock, flags);
163} 163}
164 164
165/** 165/**
@@ -173,9 +173,9 @@ static int sh_wdt_set_heartbeat(int t)
173 if (unlikely(t < 1 || t > 3600)) /* arbitrary upper limit */ 173 if (unlikely(t < 1 || t > 3600)) /* arbitrary upper limit */
174 return -EINVAL; 174 return -EINVAL;
175 175
176 spin_lock_irqsave(&wdt_lock, flags); 176 spin_lock_irqsave(&shwdt_lock, flags);
177 heartbeat = t; 177 heartbeat = t;
178 spin_unlock_irqrestore(&wdt_lock, flags); 178 spin_unlock_irqrestore(&shwdt_lock, flags);
179 return 0; 179 return 0;
180} 180}
181 181
@@ -189,7 +189,7 @@ static void sh_wdt_ping(unsigned long data)
189{ 189{
190 unsigned long flags; 190 unsigned long flags;
191 191
192 spin_lock_irqsave(&wdt_lock, flags); 192 spin_lock_irqsave(&shwdt_lock, flags);
193 if (time_before(jiffies, next_heartbeat)) { 193 if (time_before(jiffies, next_heartbeat)) {
194 __u8 csr; 194 __u8 csr;
195 195
@@ -203,7 +203,7 @@ static void sh_wdt_ping(unsigned long data)
203 } else 203 } else
204 printk(KERN_WARNING PFX "Heartbeat lost! Will not ping " 204 printk(KERN_WARNING PFX "Heartbeat lost! Will not ping "
205 "the watchdog\n"); 205 "the watchdog\n");
206 spin_unlock_irqrestore(&wdt_lock, flags); 206 spin_unlock_irqrestore(&shwdt_lock, flags);
207} 207}
208 208
209/** 209/**