diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-08 12:33:47 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-08 14:18:18 -0400 |
commit | 097d9eb537ff4d88b74c3fe67392e27c478ca3c5 (patch) | |
tree | 9034d676d9096857a380aab9d99e3e88fccb6bfe /drivers/watchdog/pnx4008_wdt.c | |
parent | c41107c2d4fd31924533f4dbc4c3428acc2b5894 (diff) | |
parent | aeee90dfa01844168cd7f8051d0a0f969c573067 (diff) |
Merge Linus' latest into master
Conflicts:
drivers/watchdog/at91rm9200_wdt.c
drivers/watchdog/davinci_wdt.c
drivers/watchdog/ep93xx_wdt.c
drivers/watchdog/ixp2000_wdt.c
drivers/watchdog/ixp4xx_wdt.c
drivers/watchdog/ks8695_wdt.c
drivers/watchdog/omap_wdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/sa1100_wdt.c
drivers/watchdog/wdt285.c
Diffstat (limited to 'drivers/watchdog/pnx4008_wdt.c')
-rw-r--r-- | drivers/watchdog/pnx4008_wdt.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index f431a0427eaa..0ed84162437b 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -28,10 +28,9 @@ | |||
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
31 | 31 | #include <linux/uaccess.h> | |
32 | #include <linux/io.h> | ||
32 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
33 | #include <asm/uaccess.h> | ||
34 | #include <asm/io.h> | ||
35 | 34 | ||
36 | #define MODULE_NAME "PNX4008-WDT: " | 35 | #define MODULE_NAME "PNX4008-WDT: " |
37 | 36 | ||
@@ -144,9 +143,8 @@ static int pnx4008_wdt_open(struct inode *inode, struct file *file) | |||
144 | return nonseekable_open(inode, file); | 143 | return nonseekable_open(inode, file); |
145 | } | 144 | } |
146 | 145 | ||
147 | static ssize_t | 146 | static ssize_t pnx4008_wdt_write(struct file *file, const char *data, |
148 | pnx4008_wdt_write(struct file *file, const char *data, size_t len, | 147 | size_t len, loff_t *ppos) |
149 | loff_t * ppos) | ||
150 | { | 148 | { |
151 | if (len) { | 149 | if (len) { |
152 | if (!nowayout) { | 150 | if (!nowayout) { |
@@ -169,15 +167,14 @@ pnx4008_wdt_write(struct file *file, const char *data, size_t len, | |||
169 | return len; | 167 | return len; |
170 | } | 168 | } |
171 | 169 | ||
172 | static struct watchdog_info ident = { | 170 | static const struct watchdog_info ident = { |
173 | .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | | 171 | .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | |
174 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, | 172 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, |
175 | .identity = "PNX4008 Watchdog", | 173 | .identity = "PNX4008 Watchdog", |
176 | }; | 174 | }; |
177 | 175 | ||
178 | static int | 176 | static long pnx4008_wdt_ioctl(struct inode *inode, struct file *file, |
179 | pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 177 | unsigned int cmd, unsigned long arg) |
180 | unsigned long arg) | ||
181 | { | 178 | { |
182 | int ret = -ENOTTY; | 179 | int ret = -ENOTTY; |
183 | int time; | 180 | int time; |
@@ -196,6 +193,11 @@ pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
196 | ret = put_user(boot_status, (int *)arg); | 193 | ret = put_user(boot_status, (int *)arg); |
197 | break; | 194 | break; |
198 | 195 | ||
196 | case WDIOC_KEEPALIVE: | ||
197 | wdt_enable(); | ||
198 | ret = 0; | ||
199 | break; | ||
200 | |||
199 | case WDIOC_SETTIMEOUT: | 201 | case WDIOC_SETTIMEOUT: |
200 | ret = get_user(time, (int *)arg); | 202 | ret = get_user(time, (int *)arg); |
201 | if (ret) | 203 | if (ret) |
@@ -213,11 +215,6 @@ pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
213 | case WDIOC_GETTIMEOUT: | 215 | case WDIOC_GETTIMEOUT: |
214 | ret = put_user(heartbeat, (int *)arg); | 216 | ret = put_user(heartbeat, (int *)arg); |
215 | break; | 217 | break; |
216 | |||
217 | case WDIOC_KEEPALIVE: | ||
218 | wdt_enable(); | ||
219 | ret = 0; | ||
220 | break; | ||
221 | } | 218 | } |
222 | return ret; | 219 | return ret; |
223 | } | 220 | } |
@@ -238,7 +235,7 @@ static const struct file_operations pnx4008_wdt_fops = { | |||
238 | .owner = THIS_MODULE, | 235 | .owner = THIS_MODULE, |
239 | .llseek = no_llseek, | 236 | .llseek = no_llseek, |
240 | .write = pnx4008_wdt_write, | 237 | .write = pnx4008_wdt_write, |
241 | .ioctl = pnx4008_wdt_ioctl, | 238 | .unlocked_ioctl = pnx4008_wdt_ioctl, |
242 | .open = pnx4008_wdt_open, | 239 | .open = pnx4008_wdt_open, |
243 | .release = pnx4008_wdt_release, | 240 | .release = pnx4008_wdt_release, |
244 | }; | 241 | }; |