aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index 7b4812776382..009b9a2c6efa 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -45,6 +45,10 @@ static void __iomem *mv64x60_wdt_regs;
45static int mv64x60_wdt_timeout; 45static int mv64x60_wdt_timeout;
46static unsigned int bus_clk; 46static unsigned int bus_clk;
47 47
48static int nowayout = WATCHDOG_NOWAYOUT;
49module_param(nowayout, int, 0);
50MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
51
48static void mv64x60_wdt_reg_write(u32 val) 52static void mv64x60_wdt_reg_write(u32 val)
49{ 53{
50 /* Allow write only to CTL1 / CTL2 fields, retaining values in 54 /* Allow write only to CTL1 / CTL2 fields, retaining values in
@@ -100,6 +104,9 @@ static int mv64x60_wdt_open(struct inode *inode, struct file *file)
100 if (test_and_set_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags)) 104 if (test_and_set_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags))
101 return -EBUSY; 105 return -EBUSY;
102 106
107 if (nowayout)
108 __module_get(THIS_MODULE);
109
103 mv64x60_wdt_service(); 110 mv64x60_wdt_service();
104 mv64x60_wdt_handler_enable(); 111 mv64x60_wdt_handler_enable();
105 112
@@ -110,9 +117,8 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file)
110{ 117{
111 mv64x60_wdt_service(); 118 mv64x60_wdt_service();
112 119
113#if !defined(CONFIG_WATCHDOG_NOWAYOUT) 120 if (!nowayout)
114 mv64x60_wdt_handler_disable(); 121 mv64x60_wdt_handler_disable();
115#endif
116 122
117 clear_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags); 123 clear_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags);
118 124