diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-12-29 13:08:11 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-29 13:08:11 -0500 |
commit | 47992cbdaef2f18a47871b2ed01ad27f568c8b73 (patch) | |
tree | bfed4f8c7ea3164afc75a85ab3624586c37c37f4 /drivers/watchdog | |
parent | 4655a0de36e8e903e99a8d152818e3aae86dae1a (diff) | |
parent | 198fc108ee4c2cd3f08954eae6a819c81c03214b (diff) |
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/sa1100_wdt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index d6fbb4657210..e19b45794717 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -36,8 +36,7 @@ | |||
36 | #include <mach/reset.h> | 36 | #include <mach/reset.h> |
37 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
38 | 38 | ||
39 | #define OSCR_FREQ CLOCK_TICK_RATE | 39 | static unsigned long oscr_freq; |
40 | |||
41 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
42 | static int pre_margin; | 41 | static int pre_margin; |
43 | static int boot_status; | 42 | static int boot_status; |
@@ -124,12 +123,12 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | |||
124 | break; | 123 | break; |
125 | } | 124 | } |
126 | 125 | ||
127 | pre_margin = OSCR_FREQ * time; | 126 | pre_margin = oscr_freq * time; |
128 | OSMR3 = OSCR + pre_margin; | 127 | OSMR3 = OSCR + pre_margin; |
129 | /*fall through*/ | 128 | /*fall through*/ |
130 | 129 | ||
131 | case WDIOC_GETTIMEOUT: | 130 | case WDIOC_GETTIMEOUT: |
132 | ret = put_user(pre_margin / OSCR_FREQ, p); | 131 | ret = put_user(pre_margin / oscr_freq, p); |
133 | break; | 132 | break; |
134 | } | 133 | } |
135 | return ret; | 134 | return ret; |
@@ -156,6 +155,8 @@ static int __init sa1100dog_init(void) | |||
156 | { | 155 | { |
157 | int ret; | 156 | int ret; |
158 | 157 | ||
158 | oscr_freq = get_clock_tick_rate(); | ||
159 | |||
159 | /* | 160 | /* |
160 | * Read the reset status, and save it for later. If | 161 | * Read the reset status, and save it for later. If |
161 | * we suspend, RCSR will be cleared, and the watchdog | 162 | * we suspend, RCSR will be cleared, and the watchdog |
@@ -163,7 +164,7 @@ static int __init sa1100dog_init(void) | |||
163 | */ | 164 | */ |
164 | boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? | 165 | boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? |
165 | WDIOF_CARDRESET : 0; | 166 | WDIOF_CARDRESET : 0; |
166 | pre_margin = OSCR_FREQ * margin; | 167 | pre_margin = oscr_freq * margin; |
167 | 168 | ||
168 | ret = misc_register(&sa1100dog_miscdev); | 169 | ret = misc_register(&sa1100dog_miscdev); |
169 | if (ret == 0) | 170 | if (ret == 0) |