Loading drivers/watchdog/sa1100_wdt.c +15 −17 Original line number Diff line number Diff line Loading @@ -26,13 +26,13 @@ #include <linux/watchdog.h> #include <linux/init.h> #include <linux/bitops.h> #include <linux/uaccess.h> #ifdef CONFIG_ARCH_PXA #include <asm/arch/pxa-regs.h> #endif #include <asm/hardware.h> #include <asm/uaccess.h> #define OSCR_FREQ CLOCK_TICK_RATE Loading Loading @@ -66,28 +66,27 @@ static int sa1100dog_open(struct inode *inode, struct file *file) static int sa1100dog_release(struct inode *inode, struct file *file) { printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); clear_bit(1, &sa1100wdt_users); return 0; } static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (len) /* Refresh OSMR3 timer. */ OSMR3 = OSCR + pre_margin; return len; } static struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, static const struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "SA1100/PXA255 Watchdog", }; static int sa1100dog_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) static long sa1100dog_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int ret = -ENOTTY; int time; Loading Loading @@ -134,18 +133,16 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, return ret; } static const struct file_operations sa1100dog_fops = { static const struct file_operations sa1100dog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = sa1100dog_write, .ioctl = sa1100dog_ioctl, .unlocked_ioctl = sa1100dog_ioctl, .open = sa1100dog_open, .release = sa1100dog_release, }; static struct miscdevice sa1100dog_miscdev = { static struct miscdevice sa1100dog_miscdev = { .minor = WATCHDOG_MINOR, .name = "watchdog", .fops = &sa1100dog_fops, Loading @@ -167,7 +164,8 @@ static int __init sa1100dog_init(void) ret = misc_register(&sa1100dog_miscdev); if (ret == 0) printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", printk(KERN_INFO "SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", margin); return ret; } Loading Loading
drivers/watchdog/sa1100_wdt.c +15 −17 Original line number Diff line number Diff line Loading @@ -26,13 +26,13 @@ #include <linux/watchdog.h> #include <linux/init.h> #include <linux/bitops.h> #include <linux/uaccess.h> #ifdef CONFIG_ARCH_PXA #include <asm/arch/pxa-regs.h> #endif #include <asm/hardware.h> #include <asm/uaccess.h> #define OSCR_FREQ CLOCK_TICK_RATE Loading Loading @@ -66,28 +66,27 @@ static int sa1100dog_open(struct inode *inode, struct file *file) static int sa1100dog_release(struct inode *inode, struct file *file) { printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); clear_bit(1, &sa1100wdt_users); return 0; } static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (len) /* Refresh OSMR3 timer. */ OSMR3 = OSCR + pre_margin; return len; } static struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, static const struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "SA1100/PXA255 Watchdog", }; static int sa1100dog_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) static long sa1100dog_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int ret = -ENOTTY; int time; Loading Loading @@ -134,18 +133,16 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, return ret; } static const struct file_operations sa1100dog_fops = { static const struct file_operations sa1100dog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = sa1100dog_write, .ioctl = sa1100dog_ioctl, .unlocked_ioctl = sa1100dog_ioctl, .open = sa1100dog_open, .release = sa1100dog_release, }; static struct miscdevice sa1100dog_miscdev = { static struct miscdevice sa1100dog_miscdev = { .minor = WATCHDOG_MINOR, .name = "watchdog", .fops = &sa1100dog_fops, Loading @@ -167,7 +164,8 @@ static int __init sa1100dog_init(void) ret = misc_register(&sa1100dog_miscdev); if (ret == 0) printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", printk(KERN_INFO "SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", margin); return ret; } Loading