diff options
40 files changed, 199 insertions, 227 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 50d44b4b466..32b9fe15364 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -463,7 +463,7 @@ config PC87413_WDT | |||
463 | module will be called pc87413_wdt. | 463 | module will be called pc87413_wdt. |
464 | 464 | ||
465 | Most people will say N. | 465 | Most people will say N. |
466 | 466 | ||
467 | config 60XX_WDT | 467 | config 60XX_WDT |
468 | tristate "SBC-60XX Watchdog Timer" | 468 | tristate "SBC-60XX Watchdog Timer" |
469 | depends on X86 | 469 | depends on X86 |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index cdd674ffaa2..049c9189569 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -92,7 +92,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o | |||
92 | 92 | ||
93 | # MIPS Architecture | 93 | # MIPS Architecture |
94 | obj-$(CONFIG_INDYDOG) += indydog.o | 94 | obj-$(CONFIG_INDYDOG) += indydog.o |
95 | obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o | 95 | obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o |
96 | obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o | 96 | obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o |
97 | obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o | 97 | obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o |
98 | obj-$(CONFIG_AR7_WDT) += ar7_wdt.o | 98 | obj-$(CONFIG_AR7_WDT) += ar7_wdt.o |
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index 7a5c69421f1..6e46a551395 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
@@ -126,7 +126,7 @@ static ssize_t acq_write(struct file *file, const char __user *buf, | |||
126 | if (!nowayout) { | 126 | if (!nowayout) { |
127 | size_t i; | 127 | size_t i; |
128 | /* note: just in case someone wrote the magic character | 128 | /* note: just in case someone wrote the magic character |
129 | * five months ago... */ | 129 | five months ago... */ |
130 | expect_close = 0; | 130 | expect_close = 0; |
131 | /* scan to see whether or not we got the | 131 | /* scan to see whether or not we got the |
132 | magic character */ | 132 | magic character */ |
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index bfec1660047..a5110f93a75 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
@@ -47,7 +47,8 @@ | |||
47 | #define WATCHDOG_NAME "Advantech WDT" | 47 | #define WATCHDOG_NAME "Advantech WDT" |
48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
49 | 49 | ||
50 | static struct platform_device *advwdt_platform_device; /* the watchdog platform device */ | 50 | /* the watchdog platform device */ |
51 | static struct platform_device *advwdt_platform_device; | ||
51 | static unsigned long advwdt_is_open; | 52 | static unsigned long advwdt_is_open; |
52 | static char adv_expect_close; | 53 | static char adv_expect_close; |
53 | 54 | ||
@@ -120,7 +121,7 @@ static ssize_t advwdt_write(struct file *file, const char __user *buf, | |||
120 | 121 | ||
121 | for (i = 0; i != count; i++) { | 122 | for (i = 0; i != count; i++) { |
122 | char c; | 123 | char c; |
123 | if (get_user(c, buf+i)) | 124 | if (get_user(c, buf + i)) |
124 | return -EFAULT; | 125 | return -EFAULT; |
125 | if (c == 'V') | 126 | if (c == 'V') |
126 | adv_expect_close = 42; | 127 | adv_expect_close = 42; |
@@ -199,8 +200,7 @@ static int advwdt_open(struct inode *inode, struct file *file) | |||
199 | return nonseekable_open(inode, file); | 200 | return nonseekable_open(inode, file); |
200 | } | 201 | } |
201 | 202 | ||
202 | static int | 203 | static int advwdt_close(struct inode *inode, struct file *file) |
203 | advwdt_close(struct inode *inode, struct file *file) | ||
204 | { | 204 | { |
205 | if (adv_expect_close == 42) { | 205 | if (adv_expect_close == 42) { |
206 | advwdt_disable(); | 206 | advwdt_disable(); |
@@ -288,9 +288,9 @@ unreg_stop: | |||
288 | static int __devexit advwdt_remove(struct platform_device *dev) | 288 | static int __devexit advwdt_remove(struct platform_device *dev) |
289 | { | 289 | { |
290 | misc_deregister(&advwdt_miscdev); | 290 | misc_deregister(&advwdt_miscdev); |
291 | release_region(wdt_start,1); | 291 | release_region(wdt_start, 1); |
292 | if(wdt_stop != wdt_start) | 292 | if (wdt_stop != wdt_start) |
293 | release_region(wdt_stop,1); | 293 | release_region(wdt_stop, 1); |
294 | 294 | ||
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
@@ -315,7 +315,8 @@ static int __init advwdt_init(void) | |||
315 | { | 315 | { |
316 | int err; | 316 | int err; |
317 | 317 | ||
318 | printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n"); | 318 | printk(KERN_INFO |
319 | "WDT driver for Advantech single board computer initialising.\n"); | ||
319 | 320 | ||
320 | err = platform_driver_register(&advwdt_driver); | 321 | err = platform_driver_register(&advwdt_driver); |
321 | if (err) | 322 | if (err) |
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index dfa11d19043..2a7690ecf97 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c | |||
@@ -153,7 +153,7 @@ static ssize_t ali_write(struct file *file, const char __user *data, | |||
153 | the magic character */ | 153 | the magic character */ |
154 | for (i = 0; i != len; i++) { | 154 | for (i = 0; i != len; i++) { |
155 | char c; | 155 | char c; |
156 | if (get_user(c, data+i)) | 156 | if (get_user(c, data + i)) |
157 | return -EFAULT; | 157 | return -EFAULT; |
158 | if (c == 'V') | 158 | if (c == 'V') |
159 | ali_expect_release = 42; | 159 | ali_expect_release = 42; |
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c index 049c9122e40..a045ef86943 100644 --- a/drivers/watchdog/alim7101_wdt.c +++ b/drivers/watchdog/alim7101_wdt.c | |||
@@ -125,7 +125,7 @@ static void wdt_timer_ping(unsigned long data) | |||
125 | 125 | ||
126 | static void wdt_change(int writeval) | 126 | static void wdt_change(int writeval) |
127 | { | 127 | { |
128 | char tmp; | 128 | char tmp; |
129 | 129 | ||
130 | pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp); | 130 | pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp); |
131 | if (writeval == WDT_ENABLE) { | 131 | if (writeval == WDT_ENABLE) { |
@@ -198,7 +198,7 @@ static ssize_t fop_write(struct file *file, const char __user *buf, | |||
198 | /* now scan */ | 198 | /* now scan */ |
199 | for (ofs = 0; ofs != count; ofs++) { | 199 | for (ofs = 0; ofs != count; ofs++) { |
200 | char c; | 200 | char c; |
201 | if (get_user(c, buf+ofs)) | 201 | if (get_user(c, buf + ofs)) |
202 | return -EFAULT; | 202 | return -EFAULT; |
203 | if (c == 'V') | 203 | if (c == 'V') |
204 | wdt_expect_close = 42; | 204 | wdt_expect_close = 42; |
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index 9a81a205ef7..55dcbfe2bb7 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
@@ -213,7 +213,7 @@ static int ar7_wdt_notify_sys(struct notifier_block *this, | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static struct notifier_block ar7_wdt_notifier = { | 215 | static struct notifier_block ar7_wdt_notifier = { |
216 | .notifier_call = ar7_wdt_notify_sys | 216 | .notifier_call = ar7_wdt_notify_sys, |
217 | }; | 217 | }; |
218 | 218 | ||
219 | static ssize_t ar7_wdt_write(struct file *file, const char *data, | 219 | static ssize_t ar7_wdt_write(struct file *file, const char *data, |
@@ -230,7 +230,7 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data, | |||
230 | expect_close = 0; | 230 | expect_close = 0; |
231 | for (i = 0; i < len; ++i) { | 231 | for (i = 0; i < len; ++i) { |
232 | char c; | 232 | char c; |
233 | if (get_user(c, data+i)) | 233 | if (get_user(c, data + i)) |
234 | return -EFAULT; | 234 | return -EFAULT; |
235 | if (c == 'V') | 235 | if (c == 'V') |
236 | expect_close = 1; | 236 | expect_close = 1; |
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c index 4538b57f451..e8ae638e580 100644 --- a/drivers/watchdog/at32ap700x_wdt.c +++ b/drivers/watchdog/at32ap700x_wdt.c | |||
@@ -283,7 +283,7 @@ static ssize_t at32_wdt_write(struct file *file, const char __user *data, | |||
283 | */ | 283 | */ |
284 | for (i = 0; i != len; i++) { | 284 | for (i = 0; i != len; i++) { |
285 | char c; | 285 | char c; |
286 | if (get_user(c, data+i)) | 286 | if (get_user(c, data + i)) |
287 | return -EFAULT; | 287 | return -EFAULT; |
288 | if (c == 'V') | 288 | if (c == 'V') |
289 | expect_release = 42; | 289 | expect_release = 42; |
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index 96250118fd7..bbd14e34319 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c | |||
@@ -210,7 +210,7 @@ size_t count, loff_t *ppos) | |||
210 | 210 | ||
211 | for (i = 0; i != count; i++) { | 211 | for (i = 0; i != count; i++) { |
212 | char c; | 212 | char c; |
213 | if (get_user(c, buf+i)) | 213 | if (get_user(c, buf + i)) |
214 | return -EFAULT; | 214 | return -EFAULT; |
215 | if (c == 'V') | 215 | if (c == 'V') |
216 | eur_expect_close = 42; | 216 | eur_expect_close = 42; |
@@ -360,10 +360,8 @@ static int eurwdt_release(struct inode *inode, struct file *file) | |||
360 | static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code, | 360 | static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code, |
361 | void *unused) | 361 | void *unused) |
362 | { | 362 | { |
363 | if (code == SYS_DOWN || code == SYS_HALT) { | 363 | if (code == SYS_DOWN || code == SYS_HALT) |
364 | /* Turn the card off */ | 364 | eurwdt_disable_timer(); /* Turn the card off */ |
365 | eurwdt_disable_timer(); | ||
366 | } | ||
367 | 365 | ||
368 | return NOTIFY_DONE; | 366 | return NOTIFY_DONE; |
369 | } | 367 | } |
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index 04b861cfdf0..614a5c7017b 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
@@ -77,27 +77,24 @@ static int geodewdt_set_heartbeat(int val) | |||
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | 79 | ||
80 | static int | 80 | static int geodewdt_open(struct inode *inode, struct file *file) |
81 | geodewdt_open(struct inode *inode, struct file *file) | ||
82 | { | 81 | { |
83 | if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags)) | 82 | if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags)) |
84 | return -EBUSY; | 83 | return -EBUSY; |
85 | 84 | ||
86 | if (!test_and_clear_bit(WDT_FLAGS_ORPHAN, &wdt_flags)) | 85 | if (!test_and_clear_bit(WDT_FLAGS_ORPHAN, &wdt_flags)) |
87 | __module_get(THIS_MODULE); | 86 | __module_get(THIS_MODULE); |
88 | 87 | ||
89 | geodewdt_ping(); | 88 | geodewdt_ping(); |
90 | return nonseekable_open(inode, file); | 89 | return nonseekable_open(inode, file); |
91 | } | 90 | } |
92 | 91 | ||
93 | static int | 92 | static int geodewdt_release(struct inode *inode, struct file *file) |
94 | geodewdt_release(struct inode *inode, struct file *file) | ||
95 | { | 93 | { |
96 | if (safe_close) { | 94 | if (safe_close) { |
97 | geodewdt_disable(); | 95 | geodewdt_disable(); |
98 | module_put(THIS_MODULE); | 96 | module_put(THIS_MODULE); |
99 | } | 97 | } else { |
100 | else { | ||
101 | printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n"); | 98 | printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n"); |
102 | geodewdt_ping(); | 99 | geodewdt_ping(); |
103 | 100 | ||
@@ -109,11 +106,10 @@ geodewdt_release(struct inode *inode, struct file *file) | |||
109 | return 0; | 106 | return 0; |
110 | } | 107 | } |
111 | 108 | ||
112 | static ssize_t | 109 | static ssize_t geodewdt_write(struct file *file, const char __user *data, |
113 | geodewdt_write(struct file *file, const char __user *data, size_t len, | 110 | size_t len, loff_t *ppos) |
114 | loff_t *ppos) | ||
115 | { | 111 | { |
116 | if(len) { | 112 | if (len) { |
117 | if (!nowayout) { | 113 | if (!nowayout) { |
118 | size_t i; | 114 | size_t i; |
119 | safe_close = 0; | 115 | safe_close = 0; |
@@ -134,9 +130,8 @@ geodewdt_write(struct file *file, const char __user *data, size_t len, | |||
134 | return len; | 130 | return len; |
135 | } | 131 | } |
136 | 132 | ||
137 | static int | 133 | static int geodewdt_ioctl(struct inode *inode, struct file *file, |
138 | geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 134 | unsigned int cmd, unsigned long arg) |
139 | unsigned long arg) | ||
140 | { | 135 | { |
141 | void __user *argp = (void __user *)arg; | 136 | void __user *argp = (void __user *)arg; |
142 | int __user *p = argp; | 137 | int __user *p = argp; |
@@ -147,7 +142,7 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
147 | | WDIOF_MAGICCLOSE, | 142 | | WDIOF_MAGICCLOSE, |
148 | .firmware_version = 1, | 143 | .firmware_version = 1, |
149 | .identity = WATCHDOG_NAME, | 144 | .identity = WATCHDOG_NAME, |
150 | }; | 145 | }; |
151 | 146 | ||
152 | switch (cmd) { | 147 | switch (cmd) { |
153 | case WDIOC_GETSUPPORT: | 148 | case WDIOC_GETSUPPORT: |
@@ -200,22 +195,21 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
200 | } | 195 | } |
201 | 196 | ||
202 | static const struct file_operations geodewdt_fops = { | 197 | static const struct file_operations geodewdt_fops = { |
203 | .owner = THIS_MODULE, | 198 | .owner = THIS_MODULE, |
204 | .llseek = no_llseek, | 199 | .llseek = no_llseek, |
205 | .write = geodewdt_write, | 200 | .write = geodewdt_write, |
206 | .ioctl = geodewdt_ioctl, | 201 | .ioctl = geodewdt_ioctl, |
207 | .open = geodewdt_open, | 202 | .open = geodewdt_open, |
208 | .release = geodewdt_release, | 203 | .release = geodewdt_release, |
209 | }; | 204 | }; |
210 | 205 | ||
211 | static struct miscdevice geodewdt_miscdev = { | 206 | static struct miscdevice geodewdt_miscdev = { |
212 | .minor = WATCHDOG_MINOR, | 207 | .minor = WATCHDOG_MINOR, |
213 | .name = "watchdog", | 208 | .name = "watchdog", |
214 | .fops = &geodewdt_fops | 209 | .fops = &geodewdt_fops, |
215 | }; | 210 | }; |
216 | 211 | ||
217 | static int __devinit | 212 | static int __devinit geodewdt_probe(struct platform_device *dev) |
218 | geodewdt_probe(struct platform_device *dev) | ||
219 | { | 213 | { |
220 | int ret, timer; | 214 | int ret, timer; |
221 | 215 | ||
@@ -246,15 +240,13 @@ geodewdt_probe(struct platform_device *dev) | |||
246 | return ret; | 240 | return ret; |
247 | } | 241 | } |
248 | 242 | ||
249 | static int __devexit | 243 | static int __devexit geodewdt_remove(struct platform_device *dev) |
250 | geodewdt_remove(struct platform_device *dev) | ||
251 | { | 244 | { |
252 | misc_deregister(&geodewdt_miscdev); | 245 | misc_deregister(&geodewdt_miscdev); |
253 | return 0; | 246 | return 0; |
254 | } | 247 | } |
255 | 248 | ||
256 | static void | 249 | static void geodewdt_shutdown(struct platform_device *dev) |
257 | geodewdt_shutdown(struct platform_device *dev) | ||
258 | { | 250 | { |
259 | geodewdt_disable(); | 251 | geodewdt_disable(); |
260 | } | 252 | } |
@@ -269,8 +261,7 @@ static struct platform_driver geodewdt_driver = { | |||
269 | }, | 261 | }, |
270 | }; | 262 | }; |
271 | 263 | ||
272 | static int __init | 264 | static int __init geodewdt_init(void) |
273 | geodewdt_init(void) | ||
274 | { | 265 | { |
275 | int ret; | 266 | int ret; |
276 | 267 | ||
@@ -290,8 +281,7 @@ err: | |||
290 | return ret; | 281 | return ret; |
291 | } | 282 | } |
292 | 283 | ||
293 | static void __exit | 284 | static void __exit geodewdt_exit(void) |
294 | geodewdt_exit(void) | ||
295 | { | 285 | { |
296 | platform_device_unregister(geodewdt_platform_device); | 286 | platform_device_unregister(geodewdt_platform_device); |
297 | platform_driver_unregister(&geodewdt_driver); | 287 | platform_driver_unregister(&geodewdt_driver); |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 7ea8f3e844f..d039d5f2fd1 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -405,7 +405,7 @@ static int __devinit detect_cru_service(void) | |||
405 | dmi_walk(dmi_find_cru); | 405 | dmi_walk(dmi_find_cru); |
406 | 406 | ||
407 | /* if cru_rom_addr has been set then we found a CRU service */ | 407 | /* if cru_rom_addr has been set then we found a CRU service */ |
408 | return ((cru_rom_addr != NULL)? 0: -ENODEV); | 408 | return ((cru_rom_addr != NULL) ? 0: -ENODEV); |
409 | } | 409 | } |
410 | 410 | ||
411 | /* ------------------------------------------------------------------------- */ | 411 | /* ------------------------------------------------------------------------- */ |
@@ -533,7 +533,7 @@ static ssize_t hpwdt_write(struct file *file, const char __user *data, | |||
533 | /* scan to see whether or not we got the magic char. */ | 533 | /* scan to see whether or not we got the magic char. */ |
534 | for (i = 0; i != len; i++) { | 534 | for (i = 0; i != len; i++) { |
535 | char c; | 535 | char c; |
536 | if (get_user(c, data+i)) | 536 | if (get_user(c, data + i)) |
537 | return -EFAULT; | 537 | return -EFAULT; |
538 | if (c == 'V') | 538 | if (c == 'V') |
539 | expect_release = 42; | 539 | expect_release = 42; |
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index c768cb71890..c13383f7fcb 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c | |||
@@ -9,18 +9,18 @@ | |||
9 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | * | 11 | * |
12 | * based on i810-tco.c which is in turn based on softdog.c | 12 | * based on i810-tco.c which is in turn based on softdog.c |
13 | * | 13 | * |
14 | * The timer is implemented in the following I/O controller hubs: | 14 | * The timer is implemented in the following I/O controller hubs: |
15 | * (See the intel documentation on http://developer.intel.com.) | 15 | * (See the intel documentation on http://developer.intel.com.) |
16 | * 6300ESB chip : document number 300641-003 | 16 | * 6300ESB chip : document number 300641-003 |
17 | * | 17 | * |
18 | * 2004YYZZ Ross Biro | 18 | * 2004YYZZ Ross Biro |
19 | * Initial version 0.01 | 19 | * Initial version 0.01 |
20 | * 2004YYZZ Ross Biro | 20 | * 2004YYZZ Ross Biro |
21 | * Version 0.02 | 21 | * Version 0.02 |
22 | * 20050210 David Härdeman <david@2gen.com> | 22 | * 20050210 David Härdeman <david@2gen.com> |
23 | * Ported driver to kernel 2.6 | 23 | * Ported driver to kernel 2.6 |
24 | */ | 24 | */ |
25 | 25 | ||
26 | /* | 26 | /* |
@@ -108,7 +108,8 @@ MODULE_PARM_DESC(nowayout, | |||
108 | * reload register. After this the appropriate registers can be written | 108 | * reload register. After this the appropriate registers can be written |
109 | * to once before they need to be unlocked again. | 109 | * to once before they need to be unlocked again. |
110 | */ | 110 | */ |
111 | static inline void esb_unlock_registers(void) { | 111 | static inline void esb_unlock_registers(void) |
112 | { | ||
112 | writeb(ESB_UNLOCK1, ESB_RELOAD_REG); | 113 | writeb(ESB_UNLOCK1, ESB_RELOAD_REG); |
113 | writeb(ESB_UNLOCK2, ESB_RELOAD_REG); | 114 | writeb(ESB_UNLOCK2, ESB_RELOAD_REG); |
114 | } | 115 | } |
@@ -169,7 +170,7 @@ static int esb_timer_set_heartbeat(int time) | |||
169 | 170 | ||
170 | /* Write timer 2 */ | 171 | /* Write timer 2 */ |
171 | esb_unlock_registers(); | 172 | esb_unlock_registers(); |
172 | writel(val, ESB_TIMER2_REG); | 173 | writel(val, ESB_TIMER2_REG); |
173 | 174 | ||
174 | /* Reload */ | 175 | /* Reload */ |
175 | esb_unlock_registers(); | 176 | esb_unlock_registers(); |
@@ -196,7 +197,7 @@ static int esb_timer_read(void) | |||
196 | } | 197 | } |
197 | 198 | ||
198 | /* | 199 | /* |
199 | * /dev/watchdog handling | 200 | * /dev/watchdog handling |
200 | */ | 201 | */ |
201 | 202 | ||
202 | static int esb_open(struct inode *inode, struct file *file) | 203 | static int esb_open(struct inode *inode, struct file *file) |
@@ -242,7 +243,7 @@ static ssize_t esb_write(struct file *file, const char __user *data, | |||
242 | /* scan to see whether or not we got the magic character */ | 243 | /* scan to see whether or not we got the magic character */ |
243 | for (i = 0; i != len; i++) { | 244 | for (i = 0; i != len; i++) { |
244 | char c; | 245 | char c; |
245 | if (get_user(c, data+i)) | 246 | if (get_user(c, data + i)) |
246 | return -EFAULT; | 247 | return -EFAULT; |
247 | if (c == 'V') | 248 | if (c == 'V') |
248 | esb_expect_close = 42; | 249 | esb_expect_close = 42; |
@@ -262,11 +263,11 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
262 | void __user *argp = (void __user *)arg; | 263 | void __user *argp = (void __user *)arg; |
263 | int __user *p = argp; | 264 | int __user *p = argp; |
264 | static struct watchdog_info ident = { | 265 | static struct watchdog_info ident = { |
265 | .options = WDIOF_SETTIMEOUT | | 266 | .options = WDIOF_SETTIMEOUT | |
266 | WDIOF_KEEPALIVEPING | | 267 | WDIOF_KEEPALIVEPING | |
267 | WDIOF_MAGICCLOSE, | 268 | WDIOF_MAGICCLOSE, |
268 | .firmware_version = 0, | 269 | .firmware_version = 0, |
269 | .identity = ESB_MODULE_NAME, | 270 | .identity = ESB_MODULE_NAME, |
270 | }; | 271 | }; |
271 | 272 | ||
272 | switch (cmd) { | 273 | switch (cmd) { |
@@ -324,10 +325,9 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
324 | static int esb_notify_sys(struct notifier_block *this, | 325 | static int esb_notify_sys(struct notifier_block *this, |
325 | unsigned long code, void *unused) | 326 | unsigned long code, void *unused) |
326 | { | 327 | { |
327 | if (code == SYS_DOWN || code == SYS_HALT) { | 328 | if (code == SYS_DOWN || code == SYS_HALT) |
328 | /* Turn the WDT off */ | 329 | esb_timer_stop(); /* Turn the WDT off */ |
329 | esb_timer_stop(); | 330 | |
330 | } | ||
331 | return NOTIFY_DONE; | 331 | return NOTIFY_DONE; |
332 | } | 332 | } |
333 | 333 | ||
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c index e9e1f7b3fb7..ca344a85eb9 100644 --- a/drivers/watchdog/iTCO_vendor_support.c +++ b/drivers/watchdog/iTCO_vendor_support.c | |||
@@ -18,9 +18,9 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | /* Module and version information */ | 20 | /* Module and version information */ |
21 | #define DRV_NAME "iTCO_vendor_support" | 21 | #define DRV_NAME "iTCO_vendor_support" |
22 | #define DRV_VERSION "1.01" | 22 | #define DRV_VERSION "1.01" |
23 | #define DRV_RELDATE "11-Nov-2006" | 23 | #define DRV_RELDATE "11-Nov-2006" |
24 | #define PFX DRV_NAME ": " | 24 | #define PFX DRV_NAME ": " |
25 | 25 | ||
26 | /* Includes */ | 26 | /* Includes */ |
@@ -37,8 +37,8 @@ | |||
37 | 37 | ||
38 | /* iTCO defines */ | 38 | /* iTCO defines */ |
39 | #define SMI_EN acpibase + 0x30 /* SMI Control and Enable Register */ | 39 | #define SMI_EN acpibase + 0x30 /* SMI Control and Enable Register */ |
40 | #define TCOBASE acpibase + 0x60 /* TCO base address */ | 40 | #define TCOBASE acpibase + 0x60 /* TCO base address */ |
41 | #define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */ | 41 | #define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */ |
42 | 42 | ||
43 | /* List of vendor support modes */ | 43 | /* List of vendor support modes */ |
44 | /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */ | 44 | /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */ |
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index b1876643663..bfb93bc2ca9 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -55,9 +55,9 @@ | |||
55 | */ | 55 | */ |
56 | 56 | ||
57 | /* Module and version information */ | 57 | /* Module and version information */ |
58 | #define DRV_NAME "iTCO_wdt" | 58 | #define DRV_NAME "iTCO_wdt" |
59 | #define DRV_VERSION "1.03" | 59 | #define DRV_VERSION "1.03" |
60 | #define DRV_RELDATE "30-Apr-2008" | 60 | #define DRV_RELDATE "30-Apr-2008" |
61 | #define PFX DRV_NAME ": " | 61 | #define PFX DRV_NAME ": " |
62 | 62 | ||
63 | /* Includes */ | 63 | /* Includes */ |
@@ -107,7 +107,7 @@ enum iTCO_chipsets { | |||
107 | TCO_ICH9, /* ICH9 */ | 107 | TCO_ICH9, /* ICH9 */ |
108 | TCO_ICH9R, /* ICH9R */ | 108 | TCO_ICH9R, /* ICH9R */ |
109 | TCO_ICH9DH, /* ICH9DH */ | 109 | TCO_ICH9DH, /* ICH9DH */ |
110 | TCO_ICH9DO, /* ICH9DO */ | 110 | TCO_ICH9DO, /* ICH9DO */ |
111 | TCO_631XESB, /* 631xESB/632xESB */ | 111 | TCO_631XESB, /* 631xESB/632xESB */ |
112 | }; | 112 | }; |
113 | 113 | ||
@@ -497,7 +497,7 @@ static ssize_t iTCO_wdt_write(struct file *file, const char __user *data, | |||
497 | magic character */ | 497 | magic character */ |
498 | for (i = 0; i != len; i++) { | 498 | for (i = 0; i != len; i++) { |
499 | char c; | 499 | char c; |
500 | if (get_user(c, data+i)) | 500 | if (get_user(c, data + i)) |
501 | return -EFAULT; | 501 | return -EFAULT; |
502 | if (c == 'V') | 502 | if (c == 'V') |
503 | expect_release = 42; | 503 | expect_release = 42; |
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index 6aa914e5caf..05a28106e8e 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c | |||
@@ -129,8 +129,7 @@ MODULE_PARM_DESC(nowayout, | |||
129 | * Watchdog Operations | 129 | * Watchdog Operations |
130 | */ | 130 | */ |
131 | 131 | ||
132 | static void | 132 | static void ibwdt_ping(void) |
133 | ibwdt_ping(void) | ||
134 | { | 133 | { |
135 | spin_lock(&ibwdt_lock); | 134 | spin_lock(&ibwdt_lock); |
136 | 135 | ||
@@ -140,16 +139,14 @@ ibwdt_ping(void) | |||
140 | spin_unlock(&ibwdt_lock); | 139 | spin_unlock(&ibwdt_lock); |
141 | } | 140 | } |
142 | 141 | ||
143 | static void | 142 | static void ibwdt_disable(void) |
144 | ibwdt_disable(void) | ||
145 | { | 143 | { |
146 | spin_lock(&ibwdt_lock); | 144 | spin_lock(&ibwdt_lock); |
147 | outb_p(0, WDT_STOP); | 145 | outb_p(0, WDT_STOP); |
148 | spin_unlock(&ibwdt_lock); | 146 | spin_unlock(&ibwdt_lock); |
149 | } | 147 | } |
150 | 148 | ||
151 | static int | 149 | static int ibwdt_set_heartbeat(int t) |
152 | ibwdt_set_heartbeat(int t) | ||
153 | { | 150 | { |
154 | int i; | 151 | int i; |
155 | 152 | ||
@@ -263,8 +260,7 @@ static int ibwdt_open(struct inode *inode, struct file *file) | |||
263 | return nonseekable_open(inode, file); | 260 | return nonseekable_open(inode, file); |
264 | } | 261 | } |
265 | 262 | ||
266 | static int | 263 | static int ibwdt_close(struct inode *inode, struct file *file) |
267 | ibwdt_close(struct inode *inode, struct file *file) | ||
268 | { | 264 | { |
269 | if (expect_close == 42) { | 265 | if (expect_close == 42) { |
270 | ibwdt_disable(); | 266 | ibwdt_disable(); |
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c index 0b549f3ff91..b82405cfb4c 100644 --- a/drivers/watchdog/ibmasr.c +++ b/drivers/watchdog/ibmasr.c | |||
@@ -275,7 +275,7 @@ static long asr_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
275 | static const struct watchdog_info ident = { | 275 | static const struct watchdog_info ident = { |
276 | .options = WDIOF_KEEPALIVEPING | | 276 | .options = WDIOF_KEEPALIVEPING | |
277 | WDIOF_MAGICCLOSE, | 277 | WDIOF_MAGICCLOSE, |
278 | .identity = "IBM ASR" | 278 | .identity = "IBM ASR", |
279 | }; | 279 | }; |
280 | void __user *argp = (void __user *)arg; | 280 | void __user *argp = (void __user *)arg; |
281 | int __user *p = argp; | 281 | int __user *p = argp; |
@@ -345,7 +345,7 @@ static int asr_release(struct inode *inode, struct file *file) | |||
345 | 345 | ||
346 | static const struct file_operations asr_fops = { | 346 | static const struct file_operations asr_fops = { |
347 | .owner = THIS_MODULE, | 347 | .owner = THIS_MODULE, |
348 | .llseek = no_llseek, | 348 | .llseek = no_llseek, |
349 | .write = asr_write, | 349 | .write = asr_write, |
350 | .unlocked_ioctl = asr_ioctl, | 350 | .unlocked_ioctl = asr_ioctl, |
351 | .open = asr_open, | 351 | .open = asr_open, |
diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c index e0d0a90ea10..8278b13f77c 100644 --- a/drivers/watchdog/iop_wdt.c +++ b/drivers/watchdog/iop_wdt.c | |||
@@ -241,7 +241,7 @@ static int __init iop_wdt_init(void) | |||
241 | with an open */ | 241 | with an open */ |
242 | ret = misc_register(&iop_wdt_miscdev); | 242 | ret = misc_register(&iop_wdt_miscdev); |
243 | if (ret == 0) | 243 | if (ret == 0) |
244 | printk("iop watchdog timer: timeout %lu sec\n", | 244 | printk(KERN_INFO "iop watchdog timer: timeout %lu sec\n", |
245 | iop_watchdog_timeout()); | 245 | iop_watchdog_timeout()); |
246 | 246 | ||
247 | return ret; | 247 | return ret; |
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index c1db74f6e31..2270ee07c01 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c | |||
@@ -221,7 +221,7 @@ static ssize_t it8712f_wdt_write(struct file *file, const char __user *data, | |||
221 | expect_close = 0; | 221 | expect_close = 0; |
222 | for (i = 0; i < len; ++i) { | 222 | for (i = 0; i < len; ++i) { |
223 | char c; | 223 | char c; |
224 | if (get_user(c, data+i)) | 224 | if (get_user(c, data + i)) |
225 | return -EFAULT; | 225 | return -EFAULT; |
226 | if (c == 'V') | 226 | if (c == 'V') |
227 | expect_close = 42; | 227 | expect_close = 42; |
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c index b94713e4773..ef3157dc9ac 100644 --- a/drivers/watchdog/ixp4xx_wdt.c +++ b/drivers/watchdog/ixp4xx_wdt.c | |||
@@ -157,8 +157,7 @@ static int ixp4xx_wdt_release(struct inode *inode, struct file *file) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | 159 | ||
160 | static const struct file_operations ixp4xx_wdt_fops = | 160 | static const struct file_operations ixp4xx_wdt_fops = { |
161 | { | ||
162 | .owner = THIS_MODULE, | 161 | .owner = THIS_MODULE, |
163 | .llseek = no_llseek, | 162 | .llseek = no_llseek, |
164 | .write = ixp4xx_wdt_write, | 163 | .write = ixp4xx_wdt_write, |
@@ -167,8 +166,7 @@ static const struct file_operations ixp4xx_wdt_fops = | |||
167 | .release = ixp4xx_wdt_release, | 166 | .release = ixp4xx_wdt_release, |
168 | }; | 167 | }; |
169 | 168 | ||
170 | static struct miscdevice ixp4xx_wdt_miscdev = | 169 | static struct miscdevice ixp4xx_wdt_miscdev = { |
171 | { | ||
172 | .minor = WATCHDOG_MINOR, | 170 | .minor = WATCHDOG_MINOR, |
173 | .name = "watchdog", | 171 | .name = "watchdog", |
174 | .fops = &ixp4xx_wdt_fops, | 172 | .fops = &ixp4xx_wdt_fops, |
@@ -181,8 +179,8 @@ static int __init ixp4xx_wdt_init(void) | |||
181 | 179 | ||
182 | asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :); | 180 | asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :); |
183 | if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { | 181 | if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { |
184 | printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - " | 182 | printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected" |
185 | "watchdog disabled\n"); | 183 | " - watchdog disabled\n"); |
186 | 184 | ||
187 | return -ENODEV; | 185 | return -ENODEV; |
188 | } | 186 | } |
@@ -191,7 +189,8 @@ static int __init ixp4xx_wdt_init(void) | |||
191 | WDIOF_CARDRESET : 0; | 189 | WDIOF_CARDRESET : 0; |
192 | ret = misc_register(&ixp4xx_wdt_miscdev); | 190 | ret = misc_register(&ixp4xx_wdt_miscdev); |
193 | if (ret == 0) | 191 | if (ret == 0) |
194 | printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat); | 192 | printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n", |
193 | heartbeat); | ||
195 | return ret; | 194 | return ret; |
196 | } | 195 | } |
197 | 196 | ||
diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c index ce1811d5d6b..db91892558f 100644 --- a/drivers/watchdog/mpc5200_wdt.c +++ b/drivers/watchdog/mpc5200_wdt.c | |||
@@ -164,7 +164,7 @@ static int mpc5200_wdt_release(struct inode *inode, struct file *file) | |||
164 | static const struct file_operations mpc5200_wdt_fops = { | 164 | static const struct file_operations mpc5200_wdt_fops = { |
165 | .owner = THIS_MODULE, | 165 | .owner = THIS_MODULE, |
166 | .write = mpc5200_wdt_write, | 166 | .write = mpc5200_wdt_write, |
167 | .ioctl = mpc5200_wdt_ioctl, | 167 | .unlocked_ioctl = mpc5200_wdt_ioctl, |
168 | .open = mpc5200_wdt_open, | 168 | .open = mpc5200_wdt_open, |
169 | .release = mpc5200_wdt_release, | 169 | .release = mpc5200_wdt_release, |
170 | }; | 170 | }; |
@@ -219,9 +219,9 @@ static int mpc5200_wdt_probe(struct of_device *op, | |||
219 | return 0; | 219 | return 0; |
220 | 220 | ||
221 | iounmap(wdt->regs); | 221 | iounmap(wdt->regs); |
222 | out_release: | 222 | out_release: |
223 | release_mem_region(wdt->mem.start, size); | 223 | release_mem_region(wdt->mem.start, size); |
224 | out_free: | 224 | out_free: |
225 | kfree(wdt); | 225 | kfree(wdt); |
226 | return err; | 226 | return err; |
227 | } | 227 | } |
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 3c4f95599c6..2a9bfa81f9d 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c | |||
@@ -377,13 +377,13 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev) | |||
377 | 377 | ||
378 | return 0; | 378 | return 0; |
379 | 379 | ||
380 | err_irq: | 380 | err_irq: |
381 | misc_deregister(&mpcore_wdt_miscdev); | 381 | misc_deregister(&mpcore_wdt_miscdev); |
382 | err_misc: | 382 | err_misc: |
383 | iounmap(wdt->base); | 383 | iounmap(wdt->base); |
384 | err_free: | 384 | err_free: |
385 | kfree(wdt); | 385 | kfree(wdt); |
386 | err_out: | 386 | err_out: |
387 | return ret; | 387 | return ret; |
388 | } | 388 | } |
389 | 389 | ||
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index f820b82da7c..b4b7b0a4c11 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
@@ -191,14 +191,14 @@ static const struct file_operations mtx1_wdt_fops = { | |||
191 | .unlocked_ioctl = mtx1_wdt_ioctl, | 191 | .unlocked_ioctl = mtx1_wdt_ioctl, |
192 | .open = mtx1_wdt_open, | 192 | .open = mtx1_wdt_open, |
193 | .write = mtx1_wdt_write, | 193 | .write = mtx1_wdt_write, |
194 | .release = mtx1_wdt_release | 194 | .release = mtx1_wdt_release, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | 197 | ||
198 | static struct miscdevice mtx1_wdt_misc = { | 198 | static struct miscdevice mtx1_wdt_misc = { |
199 | .minor = WATCHDOG_MINOR, | 199 | .minor = WATCHDOG_MINOR, |
200 | .name = "watchdog", | 200 | .name = "watchdog", |
201 | .fops = &mtx1_wdt_fops | 201 | .fops = &mtx1_wdt_fops, |
202 | }; | 202 | }; |
203 | 203 | ||
204 | 204 | ||
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 7beb21ce1de..6f5420f478a 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -245,7 +245,7 @@ static const struct file_operations omap_wdt_fops = { | |||
245 | static struct miscdevice omap_wdt_miscdev = { | 245 | static struct miscdevice omap_wdt_miscdev = { |
246 | .minor = WATCHDOG_MINOR, | 246 | .minor = WATCHDOG_MINOR, |
247 | .name = "watchdog", | 247 | .name = "watchdog", |
248 | .fops = &omap_wdt_fops | 248 | .fops = &omap_wdt_fops, |
249 | }; | 249 | }; |
250 | 250 | ||
251 | static int __init omap_wdt_probe(struct platform_device *pdev) | 251 | static int __init omap_wdt_probe(struct platform_device *pdev) |
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index 5fc7f134995..e91ada72da1 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | /* #define DEBUG 1 */ | 39 | /* #define DEBUG 1 */ |
40 | 40 | ||
41 | #define DEFAULT_TIMEOUT 1 /* 1 minute */ | 41 | #define DEFAULT_TIMEOUT 1 /* 1 minute */ |
42 | #define MAX_TIMEOUT 255 | 42 | #define MAX_TIMEOUT 255 |
43 | 43 | ||
44 | #define VERSION "1.1" | 44 | #define VERSION "1.1" |
@@ -46,17 +46,17 @@ | |||
46 | #define PFX MODNAME ": " | 46 | #define PFX MODNAME ": " |
47 | #define DPFX MODNAME " - DEBUG: " | 47 | #define DPFX MODNAME " - DEBUG: " |
48 | 48 | ||
49 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ | 49 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ |
50 | #define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1) | 50 | #define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1) |
51 | #define SWC_LDN 0x04 | 51 | #define SWC_LDN 0x04 |
52 | #define SIOCFG2 0x22 /* Serial IO register */ | 52 | #define SIOCFG2 0x22 /* Serial IO register */ |
53 | #define WDCTL 0x10 /* Watchdog-Timer-Controll-Register */ | 53 | #define WDCTL 0x10 /* Watchdog-Timer-Controll-Register */ |
54 | #define WDTO 0x11 /* Watchdog timeout register */ | 54 | #define WDTO 0x11 /* Watchdog timeout register */ |
55 | #define WDCFG 0x12 /* Watchdog config register */ | 55 | #define WDCFG 0x12 /* Watchdog config register */ |
56 | 56 | ||
57 | static int io = 0x2E; /* Address used on Portwell Boards */ | 57 | static int io = 0x2E; /* Address used on Portwell Boards */ |
58 | 58 | ||
59 | static int timeout = DEFAULT_TIMEOUT; /* timeout value */ | 59 | static int timeout = DEFAULT_TIMEOUT; /* timeout value */ |
60 | static unsigned long timer_enabled; /* is the timer enabled? */ | 60 | static unsigned long timer_enabled; /* is the timer enabled? */ |
61 | 61 | ||
62 | static char expect_close; /* is the close expected? */ | 62 | static char expect_close; /* is the close expected? */ |
@@ -99,14 +99,14 @@ static inline void pc87413_enable_swc(void) | |||
99 | 99 | ||
100 | /* Step 2: Enable SWC functions */ | 100 | /* Step 2: Enable SWC functions */ |
101 | 101 | ||
102 | outb_p(0x07, WDT_INDEX_IO_PORT); /* Point SWC_LDN (LDN=4) */ | 102 | outb_p(0x07, WDT_INDEX_IO_PORT); /* Point SWC_LDN (LDN=4) */ |
103 | outb_p(SWC_LDN, WDT_DATA_IO_PORT); | 103 | outb_p(SWC_LDN, WDT_DATA_IO_PORT); |
104 | 104 | ||
105 | outb_p(0x30, WDT_INDEX_IO_PORT); /* Read Index 0x30 First */ | 105 | outb_p(0x30, WDT_INDEX_IO_PORT); /* Read Index 0x30 First */ |
106 | cr_data = inb(WDT_DATA_IO_PORT); | 106 | cr_data = inb(WDT_DATA_IO_PORT); |
107 | cr_data |= 0x01; /* Set Bit0 to 1 */ | 107 | cr_data |= 0x01; /* Set Bit0 to 1 */ |
108 | outb_p(0x30, WDT_INDEX_IO_PORT); | 108 | outb_p(0x30, WDT_INDEX_IO_PORT); |
109 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ | 109 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ |
110 | 110 | ||
111 | #ifdef DEBUG | 111 | #ifdef DEBUG |
112 | printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); | 112 | printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); |
@@ -122,10 +122,10 @@ static inline unsigned int pc87413_get_swc_base(void) | |||
122 | 122 | ||
123 | /* Step 3: Read SWC I/O Base Address */ | 123 | /* Step 3: Read SWC I/O Base Address */ |
124 | 124 | ||
125 | outb_p(0x60, WDT_INDEX_IO_PORT); /* Read Index 0x60 */ | 125 | outb_p(0x60, WDT_INDEX_IO_PORT); /* Read Index 0x60 */ |
126 | addr_h = inb(WDT_DATA_IO_PORT); | 126 | addr_h = inb(WDT_DATA_IO_PORT); |
127 | 127 | ||
128 | outb_p(0x61, WDT_INDEX_IO_PORT); /* Read Index 0x61 */ | 128 | outb_p(0x61, WDT_INDEX_IO_PORT); /* Read Index 0x61 */ |
129 | 129 | ||
130 | addr_l = inb(WDT_DATA_IO_PORT); | 130 | addr_l = inb(WDT_DATA_IO_PORT); |
131 | 131 | ||
@@ -374,7 +374,7 @@ static ssize_t pc87413_write(struct file *file, const char __user *data, | |||
374 | magic character */ | 374 | magic character */ |
375 | for (i = 0; i != len; i++) { | 375 | for (i = 0; i != len; i++) { |
376 | char c; | 376 | char c; |
377 | if (get_user(c, data+i)) | 377 | if (get_user(c, data + i)) |
378 | return -EFAULT; | 378 | return -EFAULT; |
379 | if (c == 'V') | 379 | if (c == 'V') |
380 | expect_close = 42; | 380 | expect_close = 42; |
@@ -413,7 +413,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd, | |||
413 | WDIOF_SETTIMEOUT | | 413 | WDIOF_SETTIMEOUT | |
414 | WDIOF_MAGICCLOSE, | 414 | WDIOF_MAGICCLOSE, |
415 | .firmware_version = 1, | 415 | .firmware_version = 1, |
416 | .identity = "PC87413(HF/F) watchdog" | 416 | .identity = "PC87413(HF/F) watchdog", |
417 | }; | 417 | }; |
418 | 418 | ||
419 | uarg.i = (int __user *)arg; | 419 | uarg.i = (int __user *)arg; |
@@ -507,7 +507,7 @@ static struct notifier_block pc87413_notifier = { | |||
507 | static struct miscdevice pc87413_miscdev = { | 507 | static struct miscdevice pc87413_miscdev = { |
508 | .minor = WATCHDOG_MINOR, | 508 | .minor = WATCHDOG_MINOR, |
509 | .name = "watchdog", | 509 | .name = "watchdog", |
510 | .fops = &pc87413_fops | 510 | .fops = &pc87413_fops, |
511 | }; | 511 | }; |
512 | 512 | ||
513 | /* -- Module init functions -------------------------------------*/ | 513 | /* -- Module init functions -------------------------------------*/ |
@@ -567,9 +567,9 @@ static void __exit pc87413_exit(void) | |||
567 | 567 | ||
568 | misc_deregister(&pc87413_miscdev); | 568 | misc_deregister(&pc87413_miscdev); |
569 | unregister_reboot_notifier(&pc87413_notifier); | 569 | unregister_reboot_notifier(&pc87413_notifier); |
570 | /* release_region(io,2); */ | 570 | /* release_region(io, 2); */ |
571 | 571 | ||
572 | printk(MODNAME " watchdog component driver removed.\n"); | 572 | printk(KERN_INFO MODNAME " watchdog component driver removed.\n"); |
573 | } | 573 | } |
574 | 574 | ||
575 | module_init(pc87413_init); | 575 | module_init(pc87413_init); |
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c index 134386a8885..3b0ddc7fcf3 100644 --- a/drivers/watchdog/pcwd.c +++ b/drivers/watchdog/pcwd.c | |||
@@ -145,7 +145,7 @@ static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 }; | |||
145 | #define CMD_ISA_RESET_RELAYS 0x0D | 145 | #define CMD_ISA_RESET_RELAYS 0x0D |
146 | 146 | ||
147 | /* Watchdog's Dip Switch heartbeat values */ | 147 | /* Watchdog's Dip Switch heartbeat values */ |
148 | static const int heartbeat_tbl [] = { | 148 | static const int heartbeat_tbl[] = { |
149 | 20, /* OFF-OFF-OFF = 20 Sec */ | 149 | 20, /* OFF-OFF-OFF = 20 Sec */ |
150 | 40, /* OFF-OFF-ON = 40 Sec */ | 150 | 40, /* OFF-OFF-ON = 40 Sec */ |
151 | 60, /* OFF-ON-OFF = 1 Min */ | 151 | 60, /* OFF-ON-OFF = 1 Min */ |
@@ -272,7 +272,7 @@ static int set_command_mode(void) | |||
272 | printk(KERN_DEBUG PFX "command_mode=%d\n", | 272 | printk(KERN_DEBUG PFX "command_mode=%d\n", |
273 | pcwd_private.command_mode); | 273 | pcwd_private.command_mode); |
274 | 274 | ||
275 | return(found); | 275 | return found; |
276 | } | 276 | } |
277 | 277 | ||
278 | static void unset_command_mode(void) | 278 | static void unset_command_mode(void) |
@@ -325,7 +325,7 @@ static inline int pcwd_get_option_switches(void) | |||
325 | } | 325 | } |
326 | 326 | ||
327 | unset_command_mode(); | 327 | unset_command_mode(); |
328 | return(option_switches); | 328 | return option_switches; |
329 | } | 329 | } |
330 | 330 | ||
331 | static void pcwd_show_card_info(void) | 331 | static void pcwd_show_card_info(void) |
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index 2617129a7cc..90eb1d4271d 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
@@ -96,7 +96,7 @@ | |||
96 | #define CMD_GET_CLEAR_RESET_COUNT 0x84 | 96 | #define CMD_GET_CLEAR_RESET_COUNT 0x84 |
97 | 97 | ||
98 | /* Watchdog's Dip Switch heartbeat values */ | 98 | /* Watchdog's Dip Switch heartbeat values */ |
99 | static const int heartbeat_tbl [] = { | 99 | static const int heartbeat_tbl[] = { |
100 | 5, /* OFF-OFF-OFF = 5 Sec */ | 100 | 5, /* OFF-OFF-OFF = 5 Sec */ |
101 | 10, /* OFF-OFF-ON = 10 Sec */ | 101 | 10, /* OFF-OFF-ON = 10 Sec */ |
102 | 30, /* OFF-ON-OFF = 30 Sec */ | 102 | 30, /* OFF-ON-OFF = 30 Sec */ |
@@ -219,11 +219,10 @@ static void pcipcwd_show_card_info(void) | |||
219 | int option_switches; | 219 | int option_switches; |
220 | 220 | ||
221 | got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); | 221 | got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); |
222 | if (got_fw_rev) { | 222 | if (got_fw_rev) |
223 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); | 223 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); |
224 | } else { | 224 | else |
225 | sprintf(fw_ver_str, "<card no answer>"); | 225 | sprintf(fw_ver_str, "<card no answer>"); |
226 | } | ||
227 | 226 | ||
228 | /* Get switch settings */ | 227 | /* Get switch settings */ |
229 | option_switches = pcipcwd_get_option_switches(); | 228 | option_switches = pcipcwd_get_option_switches(); |
@@ -330,7 +329,7 @@ static int pcipcwd_get_status(int *status) | |||
330 | { | 329 | { |
331 | int control_status; | 330 | int control_status; |
332 | 331 | ||
333 | *status=0; | 332 | *status = 0; |
334 | control_status = inb_p(pcipcwd_private.io_addr + 1); | 333 | control_status = inb_p(pcipcwd_private.io_addr + 1); |
335 | if (control_status & WD_PCI_WTRP) | 334 | if (control_status & WD_PCI_WTRP) |
336 | *status |= WDIOF_CARDRESET; | 335 | *status |= WDIOF_CARDRESET; |
@@ -368,8 +367,8 @@ static int pcipcwd_clear_status(void) | |||
368 | outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1); | 367 | outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1); |
369 | 368 | ||
370 | /* clear reset counter */ | 369 | /* clear reset counter */ |
371 | msb=0; | 370 | msb = 0; |
372 | reset_counter=0xff; | 371 | reset_counter = 0xff; |
373 | send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); | 372 | send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); |
374 | 373 | ||
375 | if (debug >= DEBUG) { | 374 | if (debug >= DEBUG) { |
@@ -441,7 +440,7 @@ static ssize_t pcipcwd_write(struct file *file, const char __user *data, | |||
441 | /* scan to see whether or not we got the magic character */ | 440 | /* scan to see whether or not we got the magic character */ |
442 | for (i = 0; i != len; i++) { | 441 | for (i = 0; i != len; i++) { |
443 | char c; | 442 | char c; |
444 | if(get_user(c, data+i)) | 443 | if (get_user(c, data + i)) |
445 | return -EFAULT; | 444 | return -EFAULT; |
446 | if (c == 'V') | 445 | if (c == 'V') |
447 | expect_release = 42; | 446 | expect_release = 42; |
@@ -471,8 +470,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd, | |||
471 | 470 | ||
472 | switch (cmd) { | 471 | switch (cmd) { |
473 | case WDIOC_GETSUPPORT: | 472 | case WDIOC_GETSUPPORT: |
474 | return copy_to_user(argp, &ident, | 473 | return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; |
475 | sizeof (ident)) ? -EFAULT : 0; | ||
476 | 474 | ||
477 | case WDIOC_GETSTATUS: | 475 | case WDIOC_GETSTATUS: |
478 | { | 476 | { |
@@ -498,7 +496,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd, | |||
498 | { | 496 | { |
499 | int new_options, retval = -EINVAL; | 497 | int new_options, retval = -EINVAL; |
500 | 498 | ||
501 | if (get_user (new_options, p)) | 499 | if (get_user(new_options, p)) |
502 | return -EFAULT; | 500 | return -EFAULT; |
503 | 501 | ||
504 | if (new_options & WDIOS_DISABLECARD) { | 502 | if (new_options & WDIOS_DISABLECARD) { |
@@ -600,7 +598,7 @@ static ssize_t pcipcwd_temp_read(struct file *file, char __user *data, | |||
600 | if (pcipcwd_get_temperature(&temperature)) | 598 | if (pcipcwd_get_temperature(&temperature)) |
601 | return -EFAULT; | 599 | return -EFAULT; |
602 | 600 | ||
603 | if (copy_to_user (data, &temperature, 1)) | 601 | if (copy_to_user(data, &temperature, 1)) |
604 | return -EFAULT; | 602 | return -EFAULT; |
605 | 603 | ||
606 | return 1; | 604 | return 1; |
@@ -625,10 +623,8 @@ static int pcipcwd_temp_release(struct inode *inode, struct file *file) | |||
625 | 623 | ||
626 | static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) | 624 | static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) |
627 | { | 625 | { |
628 | if (code==SYS_DOWN || code==SYS_HALT) { | 626 | if (code == SYS_DOWN || code == SYS_HALT) |
629 | /* Turn the WDT off */ | 627 | pcipcwd_stop(); /* Turn the WDT off */ |
630 | pcipcwd_stop(); | ||
631 | } | ||
632 | 628 | ||
633 | return NOTIFY_DONE; | 629 | return NOTIFY_DONE; |
634 | } | 630 | } |
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 8c582bc0588..c1685c942de 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" _ | |||
87 | #define USB_PCWD_PRODUCT_ID 0x1140 | 87 | #define USB_PCWD_PRODUCT_ID 0x1140 |
88 | 88 | ||
89 | /* table of devices that work with this driver */ | 89 | /* table of devices that work with this driver */ |
90 | static struct usb_device_id usb_pcwd_table [] = { | 90 | static struct usb_device_id usb_pcwd_table[] = { |
91 | { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) }, | 91 | { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) }, |
92 | { } /* Terminating entry */ | 92 | { } /* Terminating entry */ |
93 | }; | 93 | }; |
@@ -109,7 +109,7 @@ MODULE_DEVICE_TABLE (usb, usb_pcwd_table); | |||
109 | #define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG | 109 | #define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG |
110 | 110 | ||
111 | /* Watchdog's Dip Switch heartbeat values */ | 111 | /* Watchdog's Dip Switch heartbeat values */ |
112 | static const int heartbeat_tbl [] = { | 112 | static const int heartbeat_tbl[] = { |
113 | 5, /* OFF-OFF-OFF = 5 Sec */ | 113 | 5, /* OFF-OFF-OFF = 5 Sec */ |
114 | 10, /* OFF-OFF-ON = 10 Sec */ | 114 | 10, /* OFF-OFF-ON = 10 Sec */ |
115 | 30, /* OFF-ON-OFF = 30 Sec */ | 115 | 30, /* OFF-ON-OFF = 30 Sec */ |
@@ -129,15 +129,15 @@ static char expect_release; | |||
129 | 129 | ||
130 | /* Structure to hold all of our device specific stuff */ | 130 | /* Structure to hold all of our device specific stuff */ |
131 | struct usb_pcwd_private { | 131 | struct usb_pcwd_private { |
132 | struct usb_device * udev; /* save off the usb device pointer */ | 132 | struct usb_device *udev; /* save off the usb device pointer */ |
133 | struct usb_interface * interface; /* the interface for this device */ | 133 | struct usb_interface *interface; /* the interface for this device */ |
134 | 134 | ||
135 | unsigned int interface_number; /* the interface number used for cmd's */ | 135 | unsigned int interface_number; /* the interface number used for cmd's */ |
136 | 136 | ||
137 | unsigned char * intr_buffer; /* the buffer to intr data */ | 137 | unsigned char *intr_buffer; /* the buffer to intr data */ |
138 | dma_addr_t intr_dma; /* the dma address for the intr buffer */ | 138 | dma_addr_t intr_dma; /* the dma address for the intr buffer */ |
139 | size_t intr_size; /* the size of the intr buffer */ | 139 | size_t intr_size; /* the size of the intr buffer */ |
140 | struct urb * intr_urb; /* the urb used for the intr pipe */ | 140 | struct urb *intr_urb; /* the urb used for the intr pipe */ |
141 | 141 | ||
142 | unsigned char cmd_command; /* The command that is reported back */ | 142 | unsigned char cmd_command; /* The command that is reported back */ |
143 | unsigned char cmd_data_msb; /* The data MSB that is reported back */ | 143 | unsigned char cmd_data_msb; /* The data MSB that is reported back */ |
@@ -153,8 +153,8 @@ static struct usb_pcwd_private *usb_pcwd_device; | |||
153 | static DEFINE_MUTEX(disconnect_mutex); | 153 | static DEFINE_MUTEX(disconnect_mutex); |
154 | 154 | ||
155 | /* local function prototypes */ | 155 | /* local function prototypes */ |
156 | static int usb_pcwd_probe (struct usb_interface *interface, const struct usb_device_id *id); | 156 | static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_device_id *id); |
157 | static void usb_pcwd_disconnect (struct usb_interface *interface); | 157 | static void usb_pcwd_disconnect(struct usb_interface *interface); |
158 | 158 | ||
159 | /* usb specific object needed to register this driver with the usb subsystem */ | 159 | /* usb specific object needed to register this driver with the usb subsystem */ |
160 | static struct usb_driver usb_pcwd_driver = { | 160 | static struct usb_driver usb_pcwd_driver = { |
@@ -194,10 +194,10 @@ static void usb_pcwd_intr_done(struct urb *urb) | |||
194 | usb_pcwd->cmd_data_lsb = data[2]; | 194 | usb_pcwd->cmd_data_lsb = data[2]; |
195 | 195 | ||
196 | /* notify anyone waiting that the cmd has finished */ | 196 | /* notify anyone waiting that the cmd has finished */ |
197 | atomic_set (&usb_pcwd->cmd_received, 1); | 197 | atomic_set(&usb_pcwd->cmd_received, 1); |
198 | 198 | ||
199 | resubmit: | 199 | resubmit: |
200 | retval = usb_submit_urb (urb, GFP_ATOMIC); | 200 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
201 | if (retval) | 201 | if (retval) |
202 | printk(KERN_ERR PFX "can't resubmit intr, usb_submit_urb failed with result %d\n", | 202 | printk(KERN_ERR PFX "can't resubmit intr, usb_submit_urb failed with result %d\n", |
203 | retval); | 203 | retval); |
@@ -223,7 +223,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned cha | |||
223 | dbg("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x", | 223 | dbg("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x", |
224 | buf[0], buf[1], buf[2]); | 224 | buf[0], buf[1], buf[2]); |
225 | 225 | ||
226 | atomic_set (&usb_pcwd->cmd_received, 0); | 226 | atomic_set(&usb_pcwd->cmd_received, 0); |
227 | 227 | ||
228 | if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0), | 228 | if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0), |
229 | HID_REQ_SET_REPORT, HID_DT_REPORT, | 229 | HID_REQ_SET_REPORT, HID_DT_REPORT, |
@@ -236,7 +236,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned cha | |||
236 | got_response = 0; | 236 | got_response = 0; |
237 | for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response); count++) { | 237 | for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response); count++) { |
238 | mdelay(1); | 238 | mdelay(1); |
239 | if (atomic_read (&usb_pcwd->cmd_received)) | 239 | if (atomic_read(&usb_pcwd->cmd_received)) |
240 | got_response = 1; | 240 | got_response = 1; |
241 | } | 241 | } |
242 | 242 | ||
@@ -355,7 +355,7 @@ static ssize_t usb_pcwd_write(struct file *file, const char __user *data, | |||
355 | /* scan to see whether or not we got the magic character */ | 355 | /* scan to see whether or not we got the magic character */ |
356 | for (i = 0; i != len; i++) { | 356 | for (i = 0; i != len; i++) { |
357 | char c; | 357 | char c; |
358 | if(get_user(c, data+i)) | 358 | if (get_user(c, data + i)) |
359 | return -EFAULT; | 359 | return -EFAULT; |
360 | if (c == 'V') | 360 | if (c == 'V') |
361 | expect_release = 42; | 361 | expect_release = 42; |
@@ -383,8 +383,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd, | |||
383 | 383 | ||
384 | switch (cmd) { | 384 | switch (cmd) { |
385 | case WDIOC_GETSUPPORT: | 385 | case WDIOC_GETSUPPORT: |
386 | return copy_to_user(argp, &ident, | 386 | return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; |
387 | sizeof (ident)) ? -EFAULT : 0; | ||
388 | 387 | ||
389 | case WDIOC_GETSTATUS: | 388 | case WDIOC_GETSTATUS: |
390 | case WDIOC_GETBOOTSTATUS: | 389 | case WDIOC_GETBOOTSTATUS: |
@@ -404,7 +403,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd, | |||
404 | { | 403 | { |
405 | int new_options, retval = -EINVAL; | 404 | int new_options, retval = -EINVAL; |
406 | 405 | ||
407 | if (get_user (new_options, p)) | 406 | if (get_user(new_options, p)) |
408 | return -EFAULT; | 407 | return -EFAULT; |
409 | 408 | ||
410 | if (new_options & WDIOS_DISABLECARD) { | 409 | if (new_options & WDIOS_DISABLECARD) { |
@@ -518,10 +517,8 @@ static int usb_pcwd_temperature_release(struct inode *inode, struct file *file) | |||
518 | 517 | ||
519 | static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) | 518 | static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) |
520 | { | 519 | { |
521 | if (code==SYS_DOWN || code==SYS_HALT) { | 520 | if (code == SYS_DOWN || code == SYS_HALT) |
522 | /* Turn the WDT off */ | 521 | usb_pcwd_stop(usb_pcwd_device); /* Turn the WDT off */ |
523 | usb_pcwd_stop(usb_pcwd_device); | ||
524 | } | ||
525 | 522 | ||
526 | return NOTIFY_DONE; | 523 | return NOTIFY_DONE; |
527 | } | 524 | } |
@@ -566,13 +563,13 @@ static struct notifier_block usb_pcwd_notifier = { | |||
566 | /** | 563 | /** |
567 | * usb_pcwd_delete | 564 | * usb_pcwd_delete |
568 | */ | 565 | */ |
569 | static inline void usb_pcwd_delete (struct usb_pcwd_private *usb_pcwd) | 566 | static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) |
570 | { | 567 | { |
571 | usb_free_urb(usb_pcwd->intr_urb); | 568 | usb_free_urb(usb_pcwd->intr_urb); |
572 | if (usb_pcwd->intr_buffer != NULL) | 569 | if (usb_pcwd->intr_buffer != NULL) |
573 | usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size, | 570 | usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size, |
574 | usb_pcwd->intr_buffer, usb_pcwd->intr_dma); | 571 | usb_pcwd->intr_buffer, usb_pcwd->intr_dma); |
575 | kfree (usb_pcwd); | 572 | kfree(usb_pcwd); |
576 | } | 573 | } |
577 | 574 | ||
578 | /** | 575 | /** |
@@ -625,7 +622,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi | |||
625 | maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); | 622 | maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); |
626 | 623 | ||
627 | /* allocate memory for our device and initialize it */ | 624 | /* allocate memory for our device and initialize it */ |
628 | usb_pcwd = kzalloc (sizeof(struct usb_pcwd_private), GFP_KERNEL); | 625 | usb_pcwd = kzalloc(sizeof(struct usb_pcwd_private), GFP_KERNEL); |
629 | if (usb_pcwd == NULL) { | 626 | if (usb_pcwd == NULL) { |
630 | printk(KERN_ERR PFX "Out of memory\n"); | 627 | printk(KERN_ERR PFX "Out of memory\n"); |
631 | goto error; | 628 | goto error; |
@@ -640,7 +637,8 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi | |||
640 | usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8); | 637 | usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8); |
641 | 638 | ||
642 | /* set up the memory buffer's */ | 639 | /* set up the memory buffer's */ |
643 | if (!(usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma))) { | 640 | usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma); |
641 | if (!usb_pcwd->intr_buffer) { | ||
644 | printk(KERN_ERR PFX "Out of memory\n"); | 642 | printk(KERN_ERR PFX "Out of memory\n"); |
645 | goto error; | 643 | goto error; |
646 | } | 644 | } |
@@ -674,11 +672,10 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi | |||
674 | 672 | ||
675 | /* Get the Firmware Version */ | 673 | /* Get the Firmware Version */ |
676 | got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); | 674 | got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); |
677 | if (got_fw_rev) { | 675 | if (got_fw_rev) |
678 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); | 676 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); |
679 | } else { | 677 | else |
680 | sprintf(fw_ver_str, "<card no answer>"); | 678 | sprintf(fw_ver_str, "<card no answer>"); |
681 | } | ||
682 | 679 | ||
683 | printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n", | 680 | printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n", |
684 | fw_ver_str); | 681 | fw_ver_str); |
@@ -724,7 +721,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi | |||
724 | } | 721 | } |
725 | 722 | ||
726 | /* we can register the device now, as it is ready */ | 723 | /* we can register the device now, as it is ready */ |
727 | usb_set_intfdata (interface, usb_pcwd); | 724 | usb_set_intfdata(interface, usb_pcwd); |
728 | 725 | ||
729 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 726 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", |
730 | heartbeat, nowayout); | 727 | heartbeat, nowayout); |
@@ -758,8 +755,8 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) | |||
758 | /* prevent races with open() */ | 755 | /* prevent races with open() */ |
759 | mutex_lock(&disconnect_mutex); | 756 | mutex_lock(&disconnect_mutex); |
760 | 757 | ||
761 | usb_pcwd = usb_get_intfdata (interface); | 758 | usb_pcwd = usb_get_intfdata(interface); |
762 | usb_set_intfdata (interface, NULL); | 759 | usb_set_intfdata(interface, NULL); |
763 | 760 | ||
764 | mutex_lock(&usb_pcwd->mtx); | 761 | mutex_lock(&usb_pcwd->mtx); |
765 | 762 | ||
@@ -819,5 +816,5 @@ static void __exit usb_pcwd_exit(void) | |||
819 | } | 816 | } |
820 | 817 | ||
821 | 818 | ||
822 | module_init (usb_pcwd_init); | 819 | module_init(usb_pcwd_init); |
823 | module_exit (usb_pcwd_exit); | 820 | module_exit(usb_pcwd_exit); |
diff --git a/drivers/watchdog/rm9k_wdt.c b/drivers/watchdog/rm9k_wdt.c index c172906b553..f1ae3729a19 100644 --- a/drivers/watchdog/rm9k_wdt.c +++ b/drivers/watchdog/rm9k_wdt.c | |||
@@ -234,8 +234,8 @@ static int wdt_gpi_release(struct inode *inode, struct file *file) | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | static ssize_t | 237 | static ssize_t wdt_gpi_write(struct file *f, const char __user *d, size_t s, |
238 | wdt_gpi_write(struct file *f, const char __user *d, size_t s, loff_t *o) | 238 | loff_t *o) |
239 | { | 239 | { |
240 | char val; | 240 | char val; |
241 | 241 | ||
@@ -325,8 +325,8 @@ static long wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | |||
325 | 325 | ||
326 | 326 | ||
327 | /* Shutdown notifier */ | 327 | /* Shutdown notifier */ |
328 | static int | 328 | static int wdt_gpi_notify(struct notifier_block *this, unsigned long code, |
329 | wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused) | 329 | void *unused) |
330 | { | 330 | { |
331 | if (code == SYS_DOWN || code == SYS_HALT) | 331 | if (code == SYS_DOWN || code == SYS_HALT) |
332 | wdt_gpi_stop(); | 332 | wdt_gpi_stop(); |
@@ -336,9 +336,8 @@ wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused) | |||
336 | 336 | ||
337 | 337 | ||
338 | /* Init & exit procedures */ | 338 | /* Init & exit procedures */ |
339 | static const struct resource * | 339 | static const struct resource *wdt_gpi_get_resource(struct platform_device *pdv, |
340 | wdt_gpi_get_resource(struct platform_device *pdv, const char *name, | 340 | const char *name, unsigned int type) |
341 | unsigned int type) | ||
342 | { | 341 | { |
343 | char buf[80]; | 342 | char buf[80]; |
344 | if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf) | 343 | if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf) |
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index 528097651f7..27e526a07c9 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
@@ -215,8 +215,8 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd, | |||
215 | /* | 215 | /* |
216 | * Notifier for system down | 216 | * Notifier for system down |
217 | */ | 217 | */ |
218 | static int | 218 | static int sbwdog_notify_sys(struct notifier_block *this, unsigned long code, |
219 | sbwdog_notify_sys(struct notifier_block *this, unsigned long code, void *erf) | 219 | void *erf) |
220 | { | 220 | { |
221 | if (code == SYS_DOWN || code == SYS_HALT) { | 221 | if (code == SYS_DOWN || code == SYS_HALT) { |
222 | /* | 222 | /* |
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c index e801cd46c64..3266daaaecf 100644 --- a/drivers/watchdog/sbc60xxwdt.c +++ b/drivers/watchdog/sbc60xxwdt.c | |||
@@ -183,7 +183,7 @@ static ssize_t fop_write(struct file *file, const char __user *buf, | |||
183 | magic character */ | 183 | magic character */ |
184 | for (ofs = 0; ofs != count; ofs++) { | 184 | for (ofs = 0; ofs != count; ofs++) { |
185 | char c; | 185 | char c; |
186 | if (get_user(c, buf+ofs)) | 186 | if (get_user(c, buf + ofs)) |
187 | return -EFAULT; | 187 | return -EFAULT; |
188 | if (c == 'V') | 188 | if (c == 'V') |
189 | wdt_expect_close = 42; | 189 | wdt_expect_close = 42; |
@@ -238,7 +238,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
238 | 238 | ||
239 | switch (cmd) { | 239 | switch (cmd) { |
240 | case WDIOC_GETSUPPORT: | 240 | case WDIOC_GETSUPPORT: |
241 | return copy_to_user(argp, &ident, sizeof(ident))? -EFAULT : 0; | 241 | return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; |
242 | case WDIOC_GETSTATUS: | 242 | case WDIOC_GETSTATUS: |
243 | case WDIOC_GETBOOTSTATUS: | 243 | case WDIOC_GETBOOTSTATUS: |
244 | return put_user(0, p); | 244 | return put_user(0, p); |
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c index f3bdc8227cc..23da3ccd832 100644 --- a/drivers/watchdog/sc1200wdt.c +++ b/drivers/watchdog/sc1200wdt.c | |||
@@ -279,7 +279,7 @@ static ssize_t sc1200wdt_write(struct file *file, const char __user *data, | |||
279 | for (i = 0; i != len; i++) { | 279 | for (i = 0; i != len; i++) { |
280 | char c; | 280 | char c; |
281 | 281 | ||
282 | if (get_user(c, data+i)) | 282 | if (get_user(c, data + i)) |
283 | return -EFAULT; | 283 | return -EFAULT; |
284 | if (c == 'V') | 284 | if (c == 'V') |
285 | expect_close = 42; | 285 | expect_close = 42; |
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c index fd5c09446bc..9e19a10a5bb 100644 --- a/drivers/watchdog/scx200_wdt.c +++ b/drivers/watchdog/scx200_wdt.c | |||
@@ -143,7 +143,7 @@ static ssize_t scx200_wdt_write(struct file *file, const char __user *data, | |||
143 | expect_close = 0; | 143 | expect_close = 0; |
144 | for (i = 0; i < len; ++i) { | 144 | for (i = 0; i < len; ++i) { |
145 | char c; | 145 | char c; |
146 | if (get_user(c, data+i)) | 146 | if (get_user(c, data + i)) |
147 | return -EFAULT; | 147 | return -EFAULT; |
148 | if (c == 'V') | 148 | if (c == 'V') |
149 | expect_close = 42; | 149 | expect_close = 42; |
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index 239383da6d8..988ff1d5b4b 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c | |||
@@ -408,7 +408,7 @@ static ssize_t wb_smsc_wdt_write(struct file *file, const char __user *data, | |||
408 | magic character */ | 408 | magic character */ |
409 | for (i = 0; i != len; i++) { | 409 | for (i = 0; i != len; i++) { |
410 | char c; | 410 | char c; |
411 | if (get_user(c, data+i)) | 411 | if (get_user(c, data + i)) |
412 | return -EFAULT; | 412 | return -EFAULT; |
413 | if (c == 'V') | 413 | if (c == 'V') |
414 | expect_close = 42; | 414 | expect_close = 42; |
@@ -438,7 +438,7 @@ static long wb_smsc_wdt_ioctl(struct file *file, | |||
438 | WDIOF_SETTIMEOUT | | 438 | WDIOF_SETTIMEOUT | |
439 | WDIOF_MAGICCLOSE, | 439 | WDIOF_MAGICCLOSE, |
440 | .firmware_version = 0, | 440 | .firmware_version = 0, |
441 | .identity = "SMsC 37B787 Watchdog" | 441 | .identity = "SMsC 37B787 Watchdog", |
442 | }; | 442 | }; |
443 | 443 | ||
444 | uarg.i = (int __user *)arg; | 444 | uarg.i = (int __user *)arg; |
diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c index 8382f9a9534..dbbc018a5f4 100644 --- a/drivers/watchdog/txx9wdt.c +++ b/drivers/watchdog/txx9wdt.c | |||
@@ -190,7 +190,7 @@ static struct miscdevice txx9wdt_miscdev = { | |||
190 | }; | 190 | }; |
191 | 191 | ||
192 | static struct notifier_block txx9wdt_notifier = { | 192 | static struct notifier_block txx9wdt_notifier = { |
193 | .notifier_call = txx9wdt_notify_sys | 193 | .notifier_call = txx9wdt_notify_sys, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | static int __init txx9wdt_probe(struct platform_device *dev) | 196 | static int __init txx9wdt_probe(struct platform_device *dev) |
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 59507f60999..69396adaa5c 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
@@ -180,7 +180,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, | |||
180 | 180 | ||
181 | for (i = 0; i != count; i++) { | 181 | for (i = 0; i != count; i++) { |
182 | char c; | 182 | char c; |
183 | if (get_user(c, buf+i)) | 183 | if (get_user(c, buf + i)) |
184 | return -EFAULT; | 184 | return -EFAULT; |
185 | if (c == 'V') | 185 | if (c == 'V') |
186 | expect_close = 42; | 186 | expect_close = 42; |
@@ -278,10 +278,9 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
278 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | 278 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, |
279 | void *unused) | 279 | void *unused) |
280 | { | 280 | { |
281 | if (code == SYS_DOWN || code == SYS_HALT) { | 281 | if (code == SYS_DOWN || code == SYS_HALT) |
282 | /* Turn the WDT off */ | 282 | wdt_disable(); /* Turn the WDT off */ |
283 | wdt_disable(); | 283 | |
284 | } | ||
285 | return NOTIFY_DONE; | 284 | return NOTIFY_DONE; |
286 | } | 285 | } |
287 | 286 | ||
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c index 12bd6618ed5..445d30a01ed 100644 --- a/drivers/watchdog/w83697hf_wdt.c +++ b/drivers/watchdog/w83697hf_wdt.c | |||
@@ -218,7 +218,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, | |||
218 | 218 | ||
219 | for (i = 0; i != count; i++) { | 219 | for (i = 0; i != count; i++) { |
220 | char c; | 220 | char c; |
221 | if (get_user(c, buf+i)) | 221 | if (get_user(c, buf + i)) |
222 | return -EFAULT; | 222 | return -EFAULT; |
223 | if (c == 'V') | 223 | if (c == 'V') |
224 | expect_close = 42; | 224 | expect_close = 42; |
@@ -325,10 +325,9 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
325 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | 325 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, |
326 | void *unused) | 326 | void *unused) |
327 | { | 327 | { |
328 | if (code == SYS_DOWN || code == SYS_HALT) { | 328 | if (code == SYS_DOWN || code == SYS_HALT) |
329 | /* Turn the WDT off */ | 329 | wdt_disable(); /* Turn the WDT off */ |
330 | wdt_disable(); | 330 | |
331 | } | ||
332 | return NOTIFY_DONE; | 331 | return NOTIFY_DONE; |
333 | } | 332 | } |
334 | 333 | ||
@@ -414,7 +413,7 @@ static int __init wdt_init(void) | |||
414 | w83697hf_init(); | 413 | w83697hf_init(); |
415 | if (early_disable) { | 414 | if (early_disable) { |
416 | if (wdt_running()) | 415 | if (wdt_running()) |
417 | printk (KERN_WARNING PFX "Stopping previously enabled watchdog until userland kicks in\n"); | 416 | printk(KERN_WARNING PFX "Stopping previously enabled watchdog until userland kicks in\n"); |
418 | wdt_disable(); | 417 | wdt_disable(); |
419 | } | 418 | } |
420 | 419 | ||
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index 44e81f7d432..68377ae171f 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * ICP Wafer 5823 Single Board Computer WDT driver | 2 | * ICP Wafer 5823 Single Board Computer WDT driver |
3 | * http://www.icpamerica.com/wafer_5823.php | 3 | * http://www.icpamerica.com/wafer_5823.php |
4 | * May also work on other similar models | 4 | * May also work on other similar models |
5 | * | 5 | * |
6 | * (c) Copyright 2002 Justin Cormack <justin@street-vision.com> | 6 | * (c) Copyright 2002 Justin Cormack <justin@street-vision.com> |
7 | * | 7 | * |
8 | * Release 0.02 | 8 | * Release 0.02 |
9 | * | 9 | * |
10 | * Based on advantechwdt.c which is based on wdt.c. | 10 | * Based on advantechwdt.c which is based on wdt.c. |
11 | * Original copyright messages: | 11 | * Original copyright messages: |
@@ -50,10 +50,10 @@ static DEFINE_SPINLOCK(wafwdt_lock); | |||
50 | /* | 50 | /* |
51 | * You must set these - there is no sane way to probe for this board. | 51 | * You must set these - there is no sane way to probe for this board. |
52 | * | 52 | * |
53 | * To enable, write the timeout value in seconds (1 to 255) to I/O | 53 | * To enable, write the timeout value in seconds (1 to 255) to I/O |
54 | * port WDT_START, then read the port to start the watchdog. To pat | 54 | * port WDT_START, then read the port to start the watchdog. To pat |
55 | * the dog, read port WDT_STOP to stop the timer, then read WDT_START | 55 | * the dog, read port WDT_STOP to stop the timer, then read WDT_START |
56 | * to restart it again. | 56 | * to restart it again. |
57 | */ | 57 | */ |
58 | 58 | ||
59 | static int wdt_stop = 0x843; | 59 | static int wdt_stop = 0x843; |
@@ -87,8 +87,7 @@ static void wafwdt_start(void) | |||
87 | inb_p(wdt_start); | 87 | inb_p(wdt_start); |
88 | } | 88 | } |
89 | 89 | ||
90 | static void | 90 | static void wafwdt_stop(void) |
91 | wafwdt_stop(void) | ||
92 | { | 91 | { |
93 | /* stop watchdog */ | 92 | /* stop watchdog */ |
94 | inb_p(wdt_stop); | 93 | inb_p(wdt_stop); |
@@ -199,8 +198,7 @@ static int wafwdt_open(struct inode *inode, struct file *file) | |||
199 | return nonseekable_open(inode, file); | 198 | return nonseekable_open(inode, file); |
200 | } | 199 | } |
201 | 200 | ||
202 | static int | 201 | static int wafwdt_close(struct inode *inode, struct file *file) |
203 | wafwdt_close(struct inode *inode, struct file *file) | ||
204 | { | 202 | { |
205 | if (expect_close == 42) | 203 | if (expect_close == 42) |
206 | wafwdt_stop(); | 204 | wafwdt_stop(); |
diff --git a/drivers/watchdog/wd501p.h b/drivers/watchdog/wd501p.h index a4504f40394..db34853c28a 100644 --- a/drivers/watchdog/wd501p.h +++ b/drivers/watchdog/wd501p.h | |||
@@ -12,7 +12,7 @@ | |||
12 | * http://www.cymru.net | 12 | * http://www.cymru.net |
13 | * | 13 | * |
14 | * This driver is provided under the GNU General Public License, incorporated | 14 | * This driver is provided under the GNU General Public License, incorporated |
15 | * herein by reference. The driver is provided without warranty or | 15 | * herein by reference. The driver is provided without warranty or |
16 | * support. | 16 | * support. |
17 | * | 17 | * |
18 | * Release 0.04. | 18 | * Release 0.04. |
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c index 20fd6715f25..5d3b1a8e28b 100644 --- a/drivers/watchdog/wdrtas.c +++ b/drivers/watchdog/wdrtas.c | |||
@@ -313,7 +313,7 @@ static long wdrtas_ioctl(struct file *file, unsigned int cmd, | |||
313 | static struct watchdog_info wdinfo = { | 313 | static struct watchdog_info wdinfo = { |
314 | .options = WDRTAS_SUPPORTED_MASK, | 314 | .options = WDRTAS_SUPPORTED_MASK, |
315 | .firmware_version = 0, | 315 | .firmware_version = 0, |
316 | .identity = "wdrtas" | 316 | .identity = "wdrtas", |
317 | }; | 317 | }; |
318 | 318 | ||
319 | switch (cmd) { | 319 | switch (cmd) { |
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index fb8fc014485..ed02bdb38c0 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c | |||
@@ -381,7 +381,7 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, | |||
381 | 381 | ||
382 | for (i = 0; i != count; i++) { | 382 | for (i = 0; i != count; i++) { |
383 | char c; | 383 | char c; |
384 | if (get_user(c, buf+i)) | 384 | if (get_user(c, buf + i)) |
385 | return -EFAULT; | 385 | return -EFAULT; |
386 | if (c == 'V') | 386 | if (c == 'V') |
387 | expect_close = 42; | 387 | expect_close = 42; |