vserver 1.9.3
[linux-2.6.git] / drivers / char / watchdog / sa1100_wdt.c
index 862fb9a..394ee7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Watchdog driver for the SA11x0
+ *     Watchdog driver for the SA11x0/PXA2xx
  *
  *      (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
  *          Based on SoftDog driver by Alan Cox <alan@redhat.com>
 #include <linux/watchdog.h>
 #include <linux/init.h>
 
+#ifdef CONFIG_ARCH_PXA
+#include <asm/arch/pxa-regs.h>
+#endif
+
 #include <asm/hardware.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
@@ -49,6 +53,7 @@ static int nowayout = 0;
  */
 static int sa1100dog_open(struct inode *inode, struct file *file)
 {
+       nonseekable_open(inode, file);
        if (test_and_set_bit(1,&sa1100wdt_users))
                return -EBUSY;
 
@@ -84,10 +89,6 @@ static int sa1100dog_release(struct inode *inode, struct file *file)
 
 static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
-       /* Can't seek (pwrite) on this device  */
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
-
        if (len) {
                if (!nowayout) {
                        size_t i;
@@ -165,6 +166,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
 static struct file_operations sa1100dog_fops =
 {
        .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
        .write          = sa1100dog_write,
        .ioctl          = sa1100dog_ioctl,
        .open           = sa1100dog_open,
@@ -174,7 +176,7 @@ static struct file_operations sa1100dog_fops =
 static struct miscdevice sa1100dog_miscdev =
 {
        .minor          = WATCHDOG_MINOR,
-       .name           = "SA1100 watchdog",
+       .name           = "SA1100/PXA2xx watchdog",
        .fops           = &sa1100dog_fops,
 };
 
@@ -194,7 +196,7 @@ static int __init sa1100dog_init(void)
 
        ret = misc_register(&sa1100dog_miscdev);
        if (ret == 0)
-               printk("SA1100 Watchdog Timer: timer margin %d sec\n",
+               printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
                       margin);
 
        return ret;
@@ -209,7 +211,7 @@ module_init(sa1100dog_init);
 module_exit(sa1100dog_exit);
 
 MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
-MODULE_DESCRIPTION("SA1100 Watchdog");
+MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog");
 
 module_param(margin, int, 0);
 MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");