aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-05-19 09:08:05 -0400
committerWim Van Sebroeck <wim@iguana.be>2008-06-21 10:22:30 -0400
commitf19e031265dc6e05511308a6ecb9637e335b45b0 (patch)
tree9e355f86d4c8cddd3440cfeefe35f642376c23d6 /drivers/watchdog
parentedef7a93f9414e1d4864150eabb49a618222c2bd (diff)
[WATCHDOG 36/57] sa1100_wdt: Switch to unlocked_ioctl
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')
-rw-r--r--drivers/watchdog/sa1100_wdt.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index 34a2b3b81800..869d538c02f9 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -26,13 +26,13 @@
26#include <linux/watchdog.h> 26#include <linux/watchdog.h>
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 30
30#ifdef CONFIG_ARCH_PXA 31#ifdef CONFIG_ARCH_PXA
31#include <asm/arch/pxa-regs.h> 32#include <asm/arch/pxa-regs.h>
32#endif 33#endif
33 34
34#include <asm/hardware.h> 35#include <asm/hardware.h>
35#include <asm/uaccess.h>
36 36
37#define OSCR_FREQ CLOCK_TICK_RATE 37#define OSCR_FREQ CLOCK_TICK_RATE
38 38
@@ -45,7 +45,7 @@ static int boot_status;
45 */ 45 */
46static int sa1100dog_open(struct inode *inode, struct file *file) 46static int sa1100dog_open(struct inode *inode, struct file *file)
47{ 47{
48 if (test_and_set_bit(1,&sa1100wdt_users)) 48 if (test_and_set_bit(1, &sa1100wdt_users))
49 return -EBUSY; 49 return -EBUSY;
50 50
51 /* Activate SA1100 Watchdog timer */ 51 /* Activate SA1100 Watchdog timer */
@@ -66,28 +66,27 @@ static int sa1100dog_open(struct inode *inode, struct file *file)
66static int sa1100dog_release(struct inode *inode, struct file *file) 66static int sa1100dog_release(struct inode *inode, struct file *file)
67{ 67{
68 printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); 68 printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n");
69
70 clear_bit(1, &sa1100wdt_users); 69 clear_bit(1, &sa1100wdt_users);
71
72 return 0; 70 return 0;
73} 71}
74 72
75static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) 73static ssize_t sa1100dog_write(struct file *file, const char __user *data,
74 size_t len, loff_t *ppos)
76{ 75{
77 if (len) 76 if (len)
78 /* Refresh OSMR3 timer. */ 77 /* Refresh OSMR3 timer. */
79 OSMR3 = OSCR + pre_margin; 78 OSMR3 = OSCR + pre_margin;
80
81 return len; 79 return len;
82} 80}
83 81
84static struct watchdog_info ident = { 82static const struct watchdog_info ident = {
85 .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 83 .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT
84 | WDIOF_KEEPALIVEPING,
86 .identity = "SA1100/PXA255 Watchdog", 85 .identity = "SA1100/PXA255 Watchdog",
87}; 86};
88 87
89static int sa1100dog_ioctl(struct inode *inode, struct file *file, 88static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
90 unsigned int cmd, unsigned long arg) 89 unsigned long arg)
91{ 90{
92 int ret = -ENOTTY; 91 int ret = -ENOTTY;
93 int time; 92 int time;
@@ -134,18 +133,16 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
134 return ret; 133 return ret;
135} 134}
136 135
137static const struct file_operations sa1100dog_fops = 136static const struct file_operations sa1100dog_fops = {
138{
139 .owner = THIS_MODULE, 137 .owner = THIS_MODULE,
140 .llseek = no_llseek, 138 .llseek = no_llseek,
141 .write = sa1100dog_write, 139 .write = sa1100dog_write,
142 .ioctl = sa1100dog_ioctl, 140 .unlocked_ioctl = sa1100dog_ioctl,
143 .open = sa1100dog_open, 141 .open = sa1100dog_open,
144 .release = sa1100dog_release, 142 .release = sa1100dog_release,
145}; 143};
146 144
147static struct miscdevice sa1100dog_miscdev = 145static struct miscdevice sa1100dog_miscdev = {
148{
149 .minor = WATCHDOG_MINOR, 146 .minor = WATCHDOG_MINOR,
150 .name = "watchdog", 147 .name = "watchdog",
151 .fops = &sa1100dog_fops, 148 .fops = &sa1100dog_fops,
@@ -167,8 +164,9 @@ static int __init sa1100dog_init(void)
167 164
168 ret = misc_register(&sa1100dog_miscdev); 165 ret = misc_register(&sa1100dog_miscdev);
169 if (ret == 0) 166 if (ret == 0)
170 printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", 167 printk(KERN_INFO
171 margin); 168 "SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
169 margin);
172 return ret; 170 return ret;
173} 171}
174 172