26
26
#include <linux/reboot.h>
27
27
#include <linux/init.h>
28
28
#include <linux/interrupt.h>
29
+ #include <linux/uaccess.h>
30
+ #include <linux/irq.h>
29
31
30
- #include <asm/irq.h>
31
- #include <asm/uaccess.h>
32
32
#include <asm/hardware.h>
33
33
#include <asm/mach-types.h>
34
34
#include <asm/hardware/dec21285.h>
@@ -115,8 +115,8 @@ static int watchdog_release(struct inode *inode, struct file *file)
115
115
return 0 ;
116
116
}
117
117
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 )
120
120
{
121
121
/*
122
122
* Refresh the timer.
@@ -127,19 +127,18 @@ watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
127
127
return len ;
128
128
}
129
129
130
- static struct watchdog_info ident = {
130
+ static const struct watchdog_info ident = {
131
131
.options = WDIOF_SETTIMEOUT ,
132
132
.identity = "Footbridge Watchdog" ,
133
133
};
134
134
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 )
138
137
{
139
138
unsigned int new_margin ;
140
139
int ret = - ENOTTY ;
141
140
142
- switch (cmd ) {
141
+ switch (cmd ) {
143
142
case WDIOC_GETSUPPORT :
144
143
ret = 0 ;
145
144
if (copy_to_user ((void * )arg , & ident , sizeof (ident )))
@@ -148,7 +147,7 @@ watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
148
147
149
148
case WDIOC_GETSTATUS :
150
149
case WDIOC_GETBOOTSTATUS :
151
- ret = put_user (0 ,(int * )arg );
150
+ ret = put_user (0 , (int * )arg );
152
151
break ;
153
152
154
153
case WDIOC_KEEPALIVE :
@@ -182,7 +181,7 @@ static const struct file_operations watchdog_fops = {
182
181
.owner = THIS_MODULE ,
183
182
.llseek = no_llseek ,
184
183
.write = watchdog_write ,
185
- .ioctl = watchdog_ioctl ,
184
+ .unlocked_ioctl = watchdog_ioctl ,
186
185
.open = watchdog_open ,
187
186
.release = watchdog_release ,
188
187
};
@@ -204,11 +203,13 @@ static int __init footbridge_watchdog_init(void)
204
203
if (retval < 0 )
205
204
return retval ;
206
205
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 );
209
209
210
210
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" );
212
213
return 0 ;
213
214
}
214
215
@@ -223,7 +224,7 @@ MODULE_LICENSE("GPL");
223
224
MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR );
224
225
225
226
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" );
227
228
228
229
module_init (footbridge_watchdog_init );
229
230
module_exit (footbridge_watchdog_exit );
0 commit comments