diff options
author | Alan Cox <alan@redhat.com> | 2008-05-19 09:07:54 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-06-21 10:01:31 -0400 |
commit | 72d5c0505bafae1a393f50e169e20b682d37f28e (patch) | |
tree | e13eee24622055b0abfbffbe5e55718be7f95af3 /drivers/watchdog/rm9k_wdt.c | |
parent | 84ca995c258df70a8914866e8c996845003ff938 (diff) |
[WATCHDOG 34/57] rm9k_wdt: clean up
Review and switch to unlocked_ioctl
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/rm9k_wdt.c')
-rw-r--r-- | drivers/watchdog/rm9k_wdt.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/watchdog/rm9k_wdt.c b/drivers/watchdog/rm9k_wdt.c index 5c921e471564..c172906b553c 100644 --- a/drivers/watchdog/rm9k_wdt.c +++ b/drivers/watchdog/rm9k_wdt.c | |||
@@ -29,10 +29,10 @@ | |||
29 | #include <linux/notifier.h> | 29 | #include <linux/notifier.h> |
30 | #include <linux/miscdevice.h> | 30 | #include <linux/miscdevice.h> |
31 | #include <linux/watchdog.h> | 31 | #include <linux/watchdog.h> |
32 | #include <asm/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/uaccess.h> | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/processor.h> | 35 | #include <asm/processor.h> |
35 | #include <asm/uaccess.h> | ||
36 | #include <asm/system.h> | 36 | #include <asm/system.h> |
37 | #include <asm/rm9k-ocd.h> | 37 | #include <asm/rm9k-ocd.h> |
38 | 38 | ||
@@ -53,10 +53,12 @@ static void wdt_gpi_stop(void); | |||
53 | static void wdt_gpi_set_timeout(unsigned int); | 53 | static void wdt_gpi_set_timeout(unsigned int); |
54 | static int wdt_gpi_open(struct inode *, struct file *); | 54 | static int wdt_gpi_open(struct inode *, struct file *); |
55 | static int wdt_gpi_release(struct inode *, struct file *); | 55 | static int wdt_gpi_release(struct inode *, struct file *); |
56 | static ssize_t wdt_gpi_write(struct file *, const char __user *, size_t, loff_t *); | 56 | static ssize_t wdt_gpi_write(struct file *, const char __user *, size_t, |
57 | loff_t *); | ||
57 | static long wdt_gpi_ioctl(struct file *, unsigned int, unsigned long); | 58 | static long wdt_gpi_ioctl(struct file *, unsigned int, unsigned long); |
58 | static int wdt_gpi_notify(struct notifier_block *, unsigned long, void *); | 59 | static int wdt_gpi_notify(struct notifier_block *, unsigned long, void *); |
59 | static const struct resource *wdt_gpi_get_resource(struct platform_device *, const char *, unsigned int); | 60 | static const struct resource *wdt_gpi_get_resource(struct platform_device *, |
61 | const char *, unsigned int); | ||
60 | static int __init wdt_gpi_probe(struct device *); | 62 | static int __init wdt_gpi_probe(struct device *); |
61 | static int __exit wdt_gpi_remove(struct device *); | 63 | static int __exit wdt_gpi_remove(struct device *); |
62 | 64 | ||
@@ -68,7 +70,7 @@ static int locked; | |||
68 | 70 | ||
69 | 71 | ||
70 | /* These are set from device resources */ | 72 | /* These are set from device resources */ |
71 | static void __iomem * wd_regs; | 73 | static void __iomem *wd_regs; |
72 | static unsigned int wd_irq, wd_ctr; | 74 | static unsigned int wd_irq, wd_ctr; |
73 | 75 | ||
74 | 76 | ||
@@ -216,7 +218,8 @@ static int wdt_gpi_release(struct inode *inode, struct file *file) | |||
216 | if (expect_close) { | 218 | if (expect_close) { |
217 | wdt_gpi_stop(); | 219 | wdt_gpi_stop(); |
218 | free_irq(wd_irq, &miscdev); | 220 | free_irq(wd_irq, &miscdev); |
219 | printk(KERN_INFO "%s: watchdog stopped\n", wdt_gpi_name); | 221 | printk(KERN_INFO "%s: watchdog stopped\n", |
222 | wdt_gpi_name); | ||
220 | } else { | 223 | } else { |
221 | printk(KERN_CRIT "%s: unexpected close() -" | 224 | printk(KERN_CRIT "%s: unexpected close() -" |
222 | " watchdog left running\n", | 225 | " watchdog left running\n", |
@@ -241,8 +244,7 @@ wdt_gpi_write(struct file *f, const char __user *d, size_t s, loff_t *o) | |||
241 | return s ? 1 : 0; | 244 | return s ? 1 : 0; |
242 | } | 245 | } |
243 | 246 | ||
244 | static long | 247 | static long wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg) |
245 | wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | ||
246 | { | 248 | { |
247 | long res = -ENOTTY; | 249 | long res = -ENOTTY; |
248 | const long size = _IOC_SIZE(cmd); | 250 | const long size = _IOC_SIZE(cmd); |
@@ -271,7 +273,8 @@ wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | |||
271 | case WDIOC_GETSUPPORT: | 273 | case WDIOC_GETSUPPORT: |
272 | wdinfo.options = nowayout ? | 274 | wdinfo.options = nowayout ? |
273 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING : | 275 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING : |
274 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE; | 276 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | |
277 | WDIOF_MAGICCLOSE; | ||
275 | res = __copy_to_user(argp, &wdinfo, size) ? -EFAULT : size; | 278 | res = __copy_to_user(argp, &wdinfo, size) ? -EFAULT : size; |
276 | break; | 279 | break; |
277 | 280 | ||