Skip to content

Commit d0e58ee

Browse files
Alan CoxWim Van Sebroeck
authored andcommitted
[WATCHDOG 55/57] wdt285: switch to unlocked_ioctl and tidy up oddments of coding style
Review and switch to unlocked_ioctl Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
1 parent dae67a2 commit d0e58ee

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

drivers/watchdog/wdt285.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include <linux/reboot.h>
2727
#include <linux/init.h>
2828
#include <linux/interrupt.h>
29+
#include <linux/uaccess.h>
30+
#include <linux/irq.h>
2931

30-
#include <asm/irq.h>
31-
#include <asm/uaccess.h>
3232
#include <asm/hardware.h>
3333
#include <asm/mach-types.h>
3434
#include <asm/hardware/dec21285.h>
@@ -115,8 +115,8 @@ static int watchdog_release(struct inode *inode, struct file *file)
115115
return 0;
116116
}
117117

118-
static ssize_t
119-
watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
118+
static ssize_t watchdog_write(struct file *file, const char *data,
119+
size_t len, loff_t *ppos)
120120
{
121121
/*
122122
* Refresh the timer.
@@ -127,19 +127,18 @@ watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
127127
return len;
128128
}
129129

130-
static struct watchdog_info ident = {
130+
static const struct watchdog_info ident = {
131131
.options = WDIOF_SETTIMEOUT,
132132
.identity = "Footbridge Watchdog",
133133
};
134134

135-
static int
136-
watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
137-
unsigned long arg)
135+
static long watchdog_ioctl(struct file *file, unsigned int cmd,
136+
unsigned long arg)
138137
{
139138
unsigned int new_margin;
140139
int ret = -ENOTTY;
141140

142-
switch(cmd) {
141+
switch (cmd) {
143142
case WDIOC_GETSUPPORT:
144143
ret = 0;
145144
if (copy_to_user((void *)arg, &ident, sizeof(ident)))
@@ -148,7 +147,7 @@ watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
148147

149148
case WDIOC_GETSTATUS:
150149
case WDIOC_GETBOOTSTATUS:
151-
ret = put_user(0,(int *)arg);
150+
ret = put_user(0, (int *)arg);
152151
break;
153152

154153
case WDIOC_KEEPALIVE:
@@ -182,7 +181,7 @@ static const struct file_operations watchdog_fops = {
182181
.owner = THIS_MODULE,
183182
.llseek = no_llseek,
184183
.write = watchdog_write,
185-
.ioctl = watchdog_ioctl,
184+
.unlocked_ioctl = watchdog_ioctl,
186185
.open = watchdog_open,
187186
.release = watchdog_release,
188187
};
@@ -204,11 +203,13 @@ static int __init footbridge_watchdog_init(void)
204203
if (retval < 0)
205204
return retval;
206205

207-
printk("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
208-
soft_margin);
206+
printk(KERN_INFO
207+
"Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
208+
soft_margin);
209209

210210
if (machine_is_cats())
211-
printk("Warning: Watchdog reset may not work on this machine.\n");
211+
printk(KERN_WARN
212+
"Warning: Watchdog reset may not work on this machine.\n");
212213
return 0;
213214
}
214215

@@ -223,7 +224,7 @@ MODULE_LICENSE("GPL");
223224
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
224225

225226
module_param(soft_margin, int, 0);
226-
MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds");
227+
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");
227228

228229
module_init(footbridge_watchdog_init);
229230
module_exit(footbridge_watchdog_exit);

0 commit comments

Comments
 (0)