diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/s3c2410_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/sa1100_wdt.c | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index f7f6ce82a5e2..e31925ee8346 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #undef S3C_VA_WATCHDOG | 42 | #undef S3C_VA_WATCHDOG |
43 | #define S3C_VA_WATCHDOG (0) | 43 | #define S3C_VA_WATCHDOG (0) |
44 | 44 | ||
45 | #include <asm/plat-s3c/regs-watchdog.h> | 45 | #include <plat/regs-watchdog.h> |
46 | 46 | ||
47 | #define PFX "s3c2410-wdt: " | 47 | #define PFX "s3c2410-wdt: " |
48 | 48 | ||
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index ed01e4c2beff..e19b45794717 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/uaccess.h> | 29 | #include <linux/uaccess.h> |
30 | #include <linux/timex.h> | ||
30 | 31 | ||
31 | #ifdef CONFIG_ARCH_PXA | 32 | #ifdef CONFIG_ARCH_PXA |
32 | #include <mach/pxa-regs.h> | 33 | #include <mach/pxa-regs.h> |
@@ -35,8 +36,7 @@ | |||
35 | #include <mach/reset.h> | 36 | #include <mach/reset.h> |
36 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
37 | 38 | ||
38 | #define OSCR_FREQ CLOCK_TICK_RATE | 39 | static unsigned long oscr_freq; |
39 | |||
40 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
41 | static int pre_margin; | 41 | static int pre_margin; |
42 | static int boot_status; | 42 | static int boot_status; |
@@ -123,12 +123,12 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | |||
123 | break; | 123 | break; |
124 | } | 124 | } |
125 | 125 | ||
126 | pre_margin = OSCR_FREQ * time; | 126 | pre_margin = oscr_freq * time; |
127 | OSMR3 = OSCR + pre_margin; | 127 | OSMR3 = OSCR + pre_margin; |
128 | /*fall through*/ | 128 | /*fall through*/ |
129 | 129 | ||
130 | case WDIOC_GETTIMEOUT: | 130 | case WDIOC_GETTIMEOUT: |
131 | ret = put_user(pre_margin / OSCR_FREQ, p); | 131 | ret = put_user(pre_margin / oscr_freq, p); |
132 | break; | 132 | break; |
133 | } | 133 | } |
134 | return ret; | 134 | return ret; |
@@ -155,6 +155,8 @@ static int __init sa1100dog_init(void) | |||
155 | { | 155 | { |
156 | int ret; | 156 | int ret; |
157 | 157 | ||
158 | oscr_freq = get_clock_tick_rate(); | ||
159 | |||
158 | /* | 160 | /* |
159 | * Read the reset status, and save it for later. If | 161 | * Read the reset status, and save it for later. If |
160 | * we suspend, RCSR will be cleared, and the watchdog | 162 | * we suspend, RCSR will be cleared, and the watchdog |
@@ -162,7 +164,7 @@ static int __init sa1100dog_init(void) | |||
162 | */ | 164 | */ |
163 | boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? | 165 | boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? |
164 | WDIOF_CARDRESET : 0; | 166 | WDIOF_CARDRESET : 0; |
165 | pre_margin = OSCR_FREQ * margin; | 167 | pre_margin = oscr_freq * margin; |
166 | 168 | ||
167 | ret = misc_register(&sa1100dog_miscdev); | 169 | ret = misc_register(&sa1100dog_miscdev); |
168 | if (ret == 0) | 170 | if (ret == 0) |