static int bcm63xx_wdt_remove(struct platform_device *pdev) { if (!nowayout) bcm63xx_wdt_pause(); misc_deregister(&bcm63xx_wdt_miscdev); bcm63xx_timer_unregister(TIMER_WDT_ID); return 0; }
static int bcm63xx_wdt_release(struct inode *inode, struct file *file) { if (expect_close == 42) bcm63xx_wdt_pause(); else { pr_crit("Unexpected close, not stopping watchdog!\n"); bcm63xx_wdt_start(); } clear_bit(0, &bcm63xx_wdt_device.inuse); expect_close = 0; return 0; }
static long bcm63xx_wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { void __user *argp = (void __user *)arg; int __user *p = argp; int new_value, retval = -EINVAL; switch (cmd) { case WDIOC_GETSUPPORT: return copy_to_user(argp, &bcm63xx_wdt_info, sizeof(bcm63xx_wdt_info)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: return put_user(0, p); case WDIOC_SETOPTIONS: if (get_user(new_value, p)) return -EFAULT; if (new_value & WDIOS_DISABLECARD) { bcm63xx_wdt_pause(); retval = 0; } if (new_value & WDIOS_ENABLECARD) { bcm63xx_wdt_start(); retval = 0; } return retval; case WDIOC_KEEPALIVE: bcm63xx_wdt_pet(); return 0; case WDIOC_SETTIMEOUT: if (get_user(new_value, p)) return -EFAULT; if (bcm63xx_wdt_settimeout(new_value)) return -EINVAL; bcm63xx_wdt_pet(); case WDIOC_GETTIMEOUT: return put_user(wdt_time, p); default: return -ENOTTY; } }
static void bcm63xx_wdt_shutdown(struct platform_device *pdev) { bcm63xx_wdt_pause(); }