X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fwdt_pci.c;h=c63d17ff68fcc5987d47466a7165b7cf2161a862;hb=f9296eb00ed30209424102d3c920e69617eea853;hp=9d5b5f4e5a7f73fd0a9f8ca5d2d1a34479a51d0f;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c index 9d5b5f4e5..c63d17ff6 100644 --- a/drivers/char/watchdog/wdt_pci.c +++ b/drivers/char/watchdog/wdt_pci.c @@ -333,6 +333,10 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) static ssize_t wdtpci_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; @@ -442,7 +446,7 @@ static int wdtpci_open(struct inode *inode, struct file *file) * Activate */ wdtpci_start(); - return nonseekable_open(inode, file); + return 0; } /** @@ -486,6 +490,10 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun { int temperature; + /* Can't seek (pread) on this device */ + if (ptr != &file->f_pos) + return -ESPIPE; + if (wdtpci_get_temperature(&temperature)) return -EFAULT; @@ -505,7 +513,7 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun static int wdtpci_temp_open(struct inode *inode, struct file *file) { - return nonseekable_open(inode, file); + return 0; } /**