aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/jz4740_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/jz4740_wdt.c')
-rw-r--r--drivers/watchdog/jz4740_wdt.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index 935562322b38..684ba01fb540 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -130,11 +130,18 @@ static ssize_t jz4740_wdt_write(struct file *file, const char *data,
130 size_t len, loff_t *ppos) 130 size_t len, loff_t *ppos)
131{ 131{
132 if (len) { 132 if (len) {
133 if (data[len-1] == 'V') 133 size_t i;
134 set_bit(WDT_OK_TO_CLOSE, &jz4740_wdt.status);
135 else
136 clear_bit(WDT_OK_TO_CLOSE, &jz4740_wdt.status);
137 134
135 clear_bit(WDT_OK_TO_CLOSE, &jz4740_wdt.status);
136 for (i = 0; i != len; i++) {
137 char c;
138
139 if (get_user(c, data + i))
140 return -EFAULT;
141
142 if (c == 'V')
143 set_bit(WDT_OK_TO_CLOSE, &jz4740_wdt.status);
144 }
138 jz4740_wdt_service(); 145 jz4740_wdt_service();
139 } 146 }
140 147