aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/sa1100_wdt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index ed01e4c2beff..87977156ddb8 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -35,8 +35,7 @@
35#include <mach/reset.h> 35#include <mach/reset.h>
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37 37
38#define OSCR_FREQ CLOCK_TICK_RATE 38static unsigned long oscr_freq;
39
40static unsigned long sa1100wdt_users; 39static unsigned long sa1100wdt_users;
41static int pre_margin; 40static int pre_margin;
42static int boot_status; 41static int boot_status;
@@ -123,12 +122,12 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
123 break; 122 break;
124 } 123 }
125 124
126 pre_margin = OSCR_FREQ * time; 125 pre_margin = oscr_freq * time;
127 OSMR3 = OSCR + pre_margin; 126 OSMR3 = OSCR + pre_margin;
128 /*fall through*/ 127 /*fall through*/
129 128
130 case WDIOC_GETTIMEOUT: 129 case WDIOC_GETTIMEOUT:
131 ret = put_user(pre_margin / OSCR_FREQ, p); 130 ret = put_user(pre_margin / oscr_freq, p);
132 break; 131 break;
133 } 132 }
134 return ret; 133 return ret;
@@ -155,6 +154,8 @@ static int __init sa1100dog_init(void)
155{ 154{
156 int ret; 155 int ret;
157 156
157 oscr_freq = get_clock_tick_rate();
158
158 /* 159 /*
159 * Read the reset status, and save it for later. If 160 * Read the reset status, and save it for later. If
160 * we suspend, RCSR will be cleared, and the watchdog 161 * we suspend, RCSR will be cleared, and the watchdog
@@ -162,7 +163,7 @@ static int __init sa1100dog_init(void)
162 */ 163 */
163 boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? 164 boot_status = (reset_status & RESET_STATUS_WATCHDOG) ?
164 WDIOF_CARDRESET : 0; 165 WDIOF_CARDRESET : 0;
165 pre_margin = OSCR_FREQ * margin; 166 pre_margin = oscr_freq * margin;
166 167
167 ret = misc_register(&sa1100dog_miscdev); 168 ret = misc_register(&sa1100dog_miscdev);
168 if (ret == 0) 169 if (ret == 0)