*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
static int wd_margin = WD_TIMO;
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int nowayout = 1;
-#else
-static int nowayout = 0;
-#endif
-
+static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static ssize_t
ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
break;
default:
- return -ENOIOCTLCMD;
+ return -ENOTTY;
}
return 0;
}
/* Activate */
ibwdt_ping();
spin_unlock(&ibwdt_lock);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
* Kernel Interfaces
*/
-static struct file_operations ibwdt_fops = {
+static const struct file_operations ibwdt_fops = {
.owner = THIS_MODULE,
+ .llseek = no_llseek,
.write = ibwdt_write,
.ioctl = ibwdt_ioctl,
.open = ibwdt_open,