diff options
Diffstat (limited to 'drivers/char/watchdog/at32ap700x_wdt.c')
-rw-r--r-- | drivers/char/watchdog/at32ap700x_wdt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/watchdog/at32ap700x_wdt.c b/drivers/char/watchdog/at32ap700x_wdt.c index 75e852e954e..54a516169d0 100644 --- a/drivers/char/watchdog/at32ap700x_wdt.c +++ b/drivers/char/watchdog/at32ap700x_wdt.c @@ -56,7 +56,7 @@ struct wdt_at32ap700x { void __iomem *regs; spinlock_t io_lock; int timeout; - int users; + unsigned long users; struct miscdevice miscdev; }; @@ -68,8 +68,10 @@ static char expect_release; */ static inline void at32_wdt_stop(void) { + unsigned long psel; + spin_lock(&wdt->io_lock); - unsigned long psel = wdt_readl(wdt, CTRL) & WDT_BF(CTRL_PSEL, 0x0f); + psel = wdt_readl(wdt, CTRL) & WDT_BF(CTRL_PSEL, 0x0f); wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0x55)); wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0xaa)); spin_unlock(&wdt->io_lock); |