Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
[WATCHDOG] i6300esb.c: change platform_driver to pci_driver
[WATCHDOG] i6300esb: fix unlock register with
[WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-static
[WATCHDOG] change reboot_notifier to platform-shutdown method.
[WATCHDOG] watchdog_info constify
[WATCHDOG] gef_wdt: Author corrections following split of GE Fanuc joint venture
[WATCHDOG] iTCO_wdt: clean up probe(), modify err msg
[WATCHDOG] ep93xx: watchdog timer driver for TS-72xx SBCs cleanup
[WATCHDOG] support for max63xx watchdog timer chips
[WATCHDOG] ep93xx: added platform side support for TS-72xx WDT driver
[WATCHDOG] ep93xx: implemented watchdog timer driver for TS-72xx SBCs

+1088 -193
+2
arch/arm/mach-ep93xx/include/mach/ts72xx.h
··· 65 65 #define TS72XX_RTC_DATA_PHYS_BASE 0x11700000 66 66 #define TS72XX_RTC_DATA_SIZE 0x00001000 67 67 68 + #define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000 69 + #define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000 68 70 69 71 #ifndef __ASSEMBLY__ 70 72
+21
arch/arm/mach-ep93xx/ts72xx.c
··· 166 166 .num_resources = 0, 167 167 }; 168 168 169 + static struct resource ts72xx_wdt_resources[] = { 170 + { 171 + .start = TS72XX_WDT_CONTROL_PHYS_BASE, 172 + .end = TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1, 173 + .flags = IORESOURCE_MEM, 174 + }, 175 + { 176 + .start = TS72XX_WDT_FEED_PHYS_BASE, 177 + .end = TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1, 178 + .flags = IORESOURCE_MEM, 179 + }, 180 + }; 181 + 182 + static struct platform_device ts72xx_wdt_device = { 183 + .name = "ts72xx-wdt", 184 + .id = -1, 185 + .num_resources = ARRAY_SIZE(ts72xx_wdt_resources), 186 + .resource = ts72xx_wdt_resources, 187 + }; 188 + 169 189 static struct ep93xx_eth_data ts72xx_eth_data = { 170 190 .phy_id = 1, 171 191 }; ··· 195 175 ep93xx_init_devices(); 196 176 ts72xx_register_flash(); 197 177 platform_device_register(&ts72xx_rtc_device); 178 + platform_device_register(&ts72xx_wdt_device); 198 179 199 180 ep93xx_register_eth(&ts72xx_eth_data, 1); 200 181 }
+1 -1
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
··· 553 553 return 0; 554 554 } 555 555 556 - static struct watchdog_info mpc5200_wdt_info = { 556 + static const struct watchdog_info mpc5200_wdt_info = { 557 557 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 558 558 .identity = WDT_IDENTITY, 559 559 };
+18 -2
drivers/watchdog/Kconfig
··· 55 55 To compile this driver as a module, choose M here: the 56 56 module will be called softdog. 57 57 58 + config MAX63XX_WATCHDOG 59 + tristate "Max63xx watchdog" 60 + help 61 + Support for memory mapped max63{69,70,71,72,73,74} watchdog timer. 62 + 58 63 config WM831X_WATCHDOG 59 64 tristate "WM831x watchdog" 60 65 depends on MFD_WM831X ··· 293 288 help 294 289 Say Y here if you want support for the watchdog timer on Avionic 295 290 Design Xanthos boards. 291 + 292 + config TS72XX_WATCHDOG 293 + tristate "TS-72XX SBC Watchdog" 294 + depends on MACH_TS72XX 295 + help 296 + Technologic Systems TS-7200, TS-7250 and TS-7260 boards have 297 + watchdog timer implemented in a external CPLD chip. Say Y here 298 + if you want to support for the watchdog timer on TS-72XX boards. 299 + 300 + To compile this driver as a module, choose M here: the 301 + module will be called ts72xx_wdt. 296 302 297 303 # AVR32 Architecture 298 304 ··· 861 845 # POWERPC Architecture 862 846 863 847 config GEF_WDT 864 - tristate "GE Fanuc Watchdog Timer" 848 + tristate "GE Watchdog Timer" 865 849 depends on GEF_SBC610 || GEF_SBC310 || GEF_PPC9A 866 850 ---help--- 867 - Watchdog timer found in a number of GE Fanuc single board computers. 851 + Watchdog timer found in a number of GE single board computers. 868 852 869 853 config MPC5200_WDT 870 854 bool "MPC52xx Watchdog Timer"
+2
drivers/watchdog/Makefile
··· 46 46 obj-$(CONFIG_STMP3XXX_WATCHDOG) += stmp3xxx_wdt.o 47 47 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o 48 48 obj-$(CONFIG_ADX_WATCHDOG) += adx_wdt.o 49 + obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o 49 50 50 51 # AVR32 Architecture 51 52 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o ··· 143 142 # Architecture Independant 144 143 obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o 145 144 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o 145 + obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o 146 146 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
+1 -1
drivers/watchdog/acquirewdt.c
··· 150 150 int options, retval = -EINVAL; 151 151 void __user *argp = (void __user *)arg; 152 152 int __user *p = argp; 153 - static struct watchdog_info ident = { 153 + static const struct watchdog_info ident = { 154 154 .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 155 155 .firmware_version = 1, 156 156 .identity = WATCHDOG_NAME,
+1 -1
drivers/watchdog/advantechwdt.c
··· 137 137 int new_timeout; 138 138 void __user *argp = (void __user *)arg; 139 139 int __user *p = argp; 140 - static struct watchdog_info ident = { 140 + static const struct watchdog_info ident = { 141 141 .options = WDIOF_KEEPALIVEPING | 142 142 WDIOF_SETTIMEOUT | 143 143 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/adx_wdt.c
··· 37 37 spinlock_t lock; 38 38 }; 39 39 40 - static struct watchdog_info adx_wdt_info = { 40 + static const struct watchdog_info adx_wdt_info = { 41 41 .identity = "Avionic Design Xanthos Watchdog", 42 42 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 43 43 };
+1 -1
drivers/watchdog/alim1535_wdt.c
··· 180 180 { 181 181 void __user *argp = (void __user *)arg; 182 182 int __user *p = argp; 183 - static struct watchdog_info ident = { 183 + static const struct watchdog_info ident = { 184 184 .options = WDIOF_KEEPALIVEPING | 185 185 WDIOF_SETTIMEOUT | 186 186 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/alim7101_wdt.c
··· 238 238 { 239 239 void __user *argp = (void __user *)arg; 240 240 int __user *p = argp; 241 - static struct watchdog_info ident = { 241 + static const struct watchdog_info ident = { 242 242 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT 243 243 | WDIOF_MAGICCLOSE, 244 244 .firmware_version = 1,
+1 -1
drivers/watchdog/ar7_wdt.c
··· 219 219 static long ar7_wdt_ioctl(struct file *file, 220 220 unsigned int cmd, unsigned long arg) 221 221 { 222 - static struct watchdog_info ident = { 222 + static const struct watchdog_info ident = { 223 223 .identity = LONGNAME, 224 224 .firmware_version = 1, 225 225 .options = (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
+1 -1
drivers/watchdog/at32ap700x_wdt.c
··· 202 202 return status; 203 203 } 204 204 205 - static struct watchdog_info at32_wdt_info = { 205 + static const struct watchdog_info at32_wdt_info = { 206 206 .identity = "at32ap700x watchdog", 207 207 .options = WDIOF_SETTIMEOUT | 208 208 WDIOF_KEEPALIVEPING |
+1 -1
drivers/watchdog/at91rm9200_wdt.c
··· 121 121 return 0; 122 122 } 123 123 124 - static struct watchdog_info at91_wdt_info = { 124 + static const struct watchdog_info at91_wdt_info = { 125 125 .identity = "at91 watchdog", 126 126 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 127 127 };
+1 -1
drivers/watchdog/bcm47xx_wdt.c
··· 149 149 return len; 150 150 } 151 151 152 - static struct watchdog_info bcm47xx_wdt_info = { 152 + static const struct watchdog_info bcm47xx_wdt_info = { 153 153 .identity = DRV_NAME, 154 154 .options = WDIOF_SETTIMEOUT | 155 155 WDIOF_KEEPALIVEPING |
+17 -39
drivers/watchdog/bfin_wdt.c
··· 19 19 #include <linux/miscdevice.h> 20 20 #include <linux/watchdog.h> 21 21 #include <linux/fs.h> 22 - #include <linux/notifier.h> 23 - #include <linux/reboot.h> 24 22 #include <linux/init.h> 25 23 #include <linux/interrupt.h> 26 24 #include <linux/uaccess.h> ··· 72 74 73 75 static unsigned int timeout = WATCHDOG_TIMEOUT; 74 76 static int nowayout = WATCHDOG_NOWAYOUT; 75 - static struct watchdog_info bfin_wdt_info; 77 + static const struct watchdog_info bfin_wdt_info; 76 78 static unsigned long open_check; 77 79 static char expect_close; 78 80 static DEFINE_SPINLOCK(bfin_wdt_spinlock); ··· 307 309 } 308 310 } 309 311 310 - /** 311 - * bfin_wdt_notify_sys - Notifier Handler 312 - * @this: notifier block 313 - * @code: notifier event 314 - * @unused: unused 315 - * 316 - * Handles specific events, such as turning off the watchdog during a 317 - * shutdown event. 318 - */ 319 - static int bfin_wdt_notify_sys(struct notifier_block *this, 320 - unsigned long code, void *unused) 321 - { 322 - stampit(); 323 - 324 - if (code == SYS_DOWN || code == SYS_HALT) 325 - bfin_wdt_stop(); 326 - 327 - return NOTIFY_DONE; 328 - } 329 - 330 312 #ifdef CONFIG_PM 331 313 static int state_before_suspend; 332 314 ··· 366 388 .fops = &bfin_wdt_fops, 367 389 }; 368 390 369 - static struct watchdog_info bfin_wdt_info = { 391 + static const struct watchdog_info bfin_wdt_info = { 370 392 .identity = "Blackfin Watchdog", 371 393 .options = WDIOF_SETTIMEOUT | 372 394 WDIOF_KEEPALIVEPING | 373 395 WDIOF_MAGICCLOSE, 374 396 }; 375 397 376 - static struct notifier_block bfin_wdt_notifier = { 377 - .notifier_call = bfin_wdt_notify_sys, 378 - }; 379 - 380 398 /** 381 399 * bfin_wdt_probe - Initialize module 382 400 * 383 - * Registers the misc device and notifier handler. Actual device 401 + * Registers the misc device. Actual device 384 402 * initialization is handled by bfin_wdt_open(). 385 403 */ 386 404 static int __devinit bfin_wdt_probe(struct platform_device *pdev) 387 405 { 388 406 int ret; 389 407 390 - ret = register_reboot_notifier(&bfin_wdt_notifier); 391 - if (ret) { 392 - pr_devinit(KERN_ERR PFX 393 - "cannot register reboot notifier (err=%d)\n", ret); 394 - return ret; 395 - } 396 - 397 408 ret = misc_register(&bfin_wdt_miscdev); 398 409 if (ret) { 399 410 pr_devinit(KERN_ERR PFX 400 411 "cannot register miscdev on minor=%d (err=%d)\n", 401 412 WATCHDOG_MINOR, ret); 402 - unregister_reboot_notifier(&bfin_wdt_notifier); 403 413 return ret; 404 414 } 405 415 ··· 400 434 /** 401 435 * bfin_wdt_remove - Initialize module 402 436 * 403 - * Unregisters the misc device and notifier handler. Actual device 437 + * Unregisters the misc device. Actual device 404 438 * deinitialization is handled by bfin_wdt_close(). 405 439 */ 406 440 static int __devexit bfin_wdt_remove(struct platform_device *pdev) 407 441 { 408 442 misc_deregister(&bfin_wdt_miscdev); 409 - unregister_reboot_notifier(&bfin_wdt_notifier); 410 443 return 0; 444 + } 445 + 446 + /** 447 + * bfin_wdt_shutdown - Soft Shutdown Handler 448 + * 449 + * Handles the soft shutdown event. 450 + */ 451 + static void bfin_wdt_shutdown(struct platform_device *pdev) 452 + { 453 + stampit(); 454 + 455 + bfin_wdt_stop(); 411 456 } 412 457 413 458 static struct platform_device *bfin_wdt_device; ··· 426 449 static struct platform_driver bfin_wdt_driver = { 427 450 .probe = bfin_wdt_probe, 428 451 .remove = __devexit_p(bfin_wdt_remove), 452 + .shutdown = bfin_wdt_shutdown, 429 453 .suspend = bfin_wdt_suspend, 430 454 .resume = bfin_wdt_resume, 431 455 .driver = {
+1 -1
drivers/watchdog/booke_wdt.c
··· 121 121 return count; 122 122 } 123 123 124 - static struct watchdog_info ident = { 124 + static const struct watchdog_info ident = { 125 125 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 126 126 .identity = "PowerPC Book-E Watchdog", 127 127 };
+1 -1
drivers/watchdog/coh901327_wdt.c
··· 257 257 struct watchdog_info __user *ident; 258 258 int __user *i; 259 259 } uarg; 260 - static struct watchdog_info ident = { 260 + static const struct watchdog_info ident = { 261 261 .options = WDIOF_CARDRESET | 262 262 WDIOF_SETTIMEOUT | 263 263 WDIOF_KEEPALIVEPING,
+1 -1
drivers/watchdog/cpu5wdt.c
··· 154 154 void __user *argp = (void __user *)arg; 155 155 int __user *p = argp; 156 156 unsigned int value; 157 - static struct watchdog_info ident = { 157 + static const struct watchdog_info ident = { 158 158 .options = WDIOF_CARDRESET, 159 159 .identity = "CPU5 WDT", 160 160 };
+1 -1
drivers/watchdog/cpwd.c
··· 403 403 404 404 static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 405 405 { 406 - static struct watchdog_info info = { 406 + static const struct watchdog_info info = { 407 407 .options = WDIOF_SETTIMEOUT, 408 408 .firmware_version = 1, 409 409 .identity = DRIVER_NAME,
+1 -1
drivers/watchdog/davinci_wdt.c
··· 142 142 return len; 143 143 } 144 144 145 - static struct watchdog_info ident = { 145 + static const struct watchdog_info ident = { 146 146 .options = WDIOF_KEEPALIVEPING, 147 147 .identity = "DaVinci Watchdog", 148 148 };
+1 -1
drivers/watchdog/ep93xx_wdt.c
··· 131 131 return len; 132 132 } 133 133 134 - static struct watchdog_info ident = { 134 + static const struct watchdog_info ident = { 135 135 .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE, 136 136 .identity = "EP93xx Watchdog", 137 137 };
+1 -1
drivers/watchdog/eurotechwdt.c
··· 238 238 { 239 239 void __user *argp = (void __user *)arg; 240 240 int __user *p = argp; 241 - static struct watchdog_info ident = { 241 + static const struct watchdog_info ident = { 242 242 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT 243 243 | WDIOF_MAGICCLOSE, 244 244 .firmware_version = 1,
+8 -8
drivers/watchdog/gef_wdt.c
··· 1 1 /* 2 - * GE Fanuc watchdog userspace interface 2 + * GE watchdog userspace interface 3 3 * 4 - * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 + * Author: Martyn Welch <martyn.welch@ge.com> 5 5 * 6 - * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 + * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc. 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify it 9 9 * under the terms of the GNU General Public License as published by the ··· 161 161 int timeout; 162 162 int options; 163 163 void __user *argp = (void __user *)arg; 164 - static struct watchdog_info info = { 164 + static const struct watchdog_info info = { 165 165 .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | 166 166 WDIOF_KEEPALIVEPING, 167 167 .firmware_version = 0, 168 - .identity = "GE Fanuc watchdog", 168 + .identity = "GE watchdog", 169 169 }; 170 170 171 171 switch (cmd) { ··· 311 311 312 312 static int __init gef_wdt_init(void) 313 313 { 314 - printk(KERN_INFO "GE Fanuc watchdog driver\n"); 314 + printk(KERN_INFO "GE watchdog driver\n"); 315 315 return of_register_platform_driver(&gef_wdt_driver); 316 316 } 317 317 ··· 323 323 module_init(gef_wdt_init); 324 324 module_exit(gef_wdt_exit); 325 325 326 - MODULE_AUTHOR("Martyn Welch <martyn.welch@gefanuc.com>"); 327 - MODULE_DESCRIPTION("GE Fanuc watchdog driver"); 326 + MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>"); 327 + MODULE_DESCRIPTION("GE watchdog driver"); 328 328 MODULE_LICENSE("GPL"); 329 329 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 330 330 MODULE_ALIAS("platform: gef_wdt");
+1 -1
drivers/watchdog/geodewdt.c
··· 142 142 int __user *p = argp; 143 143 int interval; 144 144 145 - static struct watchdog_info ident = { 145 + static const struct watchdog_info ident = { 146 146 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING 147 147 | WDIOF_MAGICCLOSE, 148 148 .firmware_version = 1,
+1 -1
drivers/watchdog/hpwdt.c
··· 554 554 return len; 555 555 } 556 556 557 - static struct watchdog_info ident = { 557 + static const struct watchdog_info ident = { 558 558 .options = WDIOF_SETTIMEOUT | 559 559 WDIOF_KEEPALIVEPING | 560 560 WDIOF_MAGICCLOSE,
+37 -64
drivers/watchdog/i6300esb.c
··· 34 34 #include <linux/mm.h> 35 35 #include <linux/miscdevice.h> 36 36 #include <linux/watchdog.h> 37 - #include <linux/platform_device.h> 38 37 #include <linux/init.h> 39 38 #include <linux/pci.h> 40 39 #include <linux/ioport.h> ··· 41 42 #include <linux/io.h> 42 43 43 44 /* Module and version information */ 44 - #define ESB_VERSION "0.04" 45 + #define ESB_VERSION "0.05" 45 46 #define ESB_MODULE_NAME "i6300ESB timer" 46 47 #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION 47 48 #define PFX ESB_MODULE_NAME ": " ··· 64 65 /* Config register bits */ 65 66 #define ESB_WDT_REBOOT (0x01 << 5) /* Enable reboot on timeout */ 66 67 #define ESB_WDT_FREQ (0x01 << 2) /* Decrement frequency */ 67 - #define ESB_WDT_INTTYPE (0x11 << 0) /* Interrupt type on timer1 timeout */ 68 + #define ESB_WDT_INTTYPE (0x03 << 0) /* Interrupt type on timer1 timeout */ 68 69 69 70 /* Reload register bits */ 70 71 #define ESB_WDT_TIMEOUT (0x01 << 9) /* Watchdog timed out */ ··· 81 82 static struct pci_dev *esb_pci; 82 83 static unsigned short triggered; /* The status of the watchdog upon boot */ 83 84 static char esb_expect_close; 84 - static struct platform_device *esb_platform_device; 85 + 86 + /* We can only use 1 card due to the /dev/watchdog restriction */ 87 + static int cards_found; 85 88 86 89 /* module parameters */ 87 90 /* 30 sec default heartbeat (1 < heartbeat < 2*1023) */ ··· 112 111 */ 113 112 static inline void esb_unlock_registers(void) 114 113 { 115 - writeb(ESB_UNLOCK1, ESB_RELOAD_REG); 116 - writeb(ESB_UNLOCK2, ESB_RELOAD_REG); 114 + writew(ESB_UNLOCK1, ESB_RELOAD_REG); 115 + writew(ESB_UNLOCK2, ESB_RELOAD_REG); 117 116 } 118 117 119 118 static int esb_timer_start(void) ··· 257 256 int new_heartbeat; 258 257 void __user *argp = (void __user *)arg; 259 258 int __user *p = argp; 260 - static struct watchdog_info ident = { 259 + static const struct watchdog_info ident = { 261 260 .options = WDIOF_SETTIMEOUT | 262 261 WDIOF_KEEPALIVEPING | 263 262 WDIOF_MAGICCLOSE, ··· 333 332 334 333 /* 335 334 * Data for PCI driver interface 336 - * 337 - * This data only exists for exporting the supported 338 - * PCI ids via MODULE_DEVICE_TABLE. We do not actually 339 - * register a pci_driver, because someone else might one day 340 - * want to register another driver on the same PCI id. 341 335 */ 342 336 static struct pci_device_id esb_pci_tbl[] = { 343 337 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_9), }, ··· 344 348 * Init & exit routines 345 349 */ 346 350 347 - static unsigned char __devinit esb_getdevice(void) 351 + static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) 348 352 { 349 - /* 350 - * Find the PCI device 351 - */ 352 - 353 - esb_pci = pci_get_device(PCI_VENDOR_ID_INTEL, 354 - PCI_DEVICE_ID_INTEL_ESB_9, NULL); 355 - 356 - if (!esb_pci) 357 - return 0; 358 - 359 - if (pci_enable_device(esb_pci)) { 353 + if (pci_enable_device(pdev)) { 360 354 printk(KERN_ERR PFX "failed to enable device\n"); 361 355 goto err_devput; 362 356 } 363 357 364 - if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) { 358 + if (pci_request_region(pdev, 0, ESB_MODULE_NAME)) { 365 359 printk(KERN_ERR PFX "failed to request region\n"); 366 360 goto err_disable; 367 361 } 368 362 369 - BASEADDR = pci_ioremap_bar(esb_pci, 0); 363 + BASEADDR = pci_ioremap_bar(pdev, 0); 370 364 if (BASEADDR == NULL) { 371 365 /* Something's wrong here, BASEADDR has to be set */ 372 366 printk(KERN_ERR PFX "failed to get BASEADDR\n"); ··· 364 378 } 365 379 366 380 /* Done */ 381 + esb_pci = pdev; 367 382 return 1; 368 383 369 384 err_release: 370 - pci_release_region(esb_pci, 0); 385 + pci_release_region(pdev, 0); 371 386 err_disable: 372 - pci_disable_device(esb_pci); 387 + pci_disable_device(pdev); 373 388 err_devput: 374 - pci_dev_put(esb_pci); 375 389 return 0; 376 390 } 377 391 ··· 416 430 esb_timer_set_heartbeat(heartbeat); 417 431 } 418 432 419 - static int __devinit esb_probe(struct platform_device *dev) 433 + static int __devinit esb_probe(struct pci_dev *pdev, 434 + const struct pci_device_id *ent) 420 435 { 421 436 int ret; 422 437 438 + cards_found++; 439 + if (cards_found == 1) 440 + printk(KERN_INFO PFX "Intel 6300ESB WatchDog Timer Driver v%s\n", 441 + ESB_VERSION); 442 + 443 + if (cards_found > 1) { 444 + printk(KERN_ERR PFX "This driver only supports 1 device\n"); 445 + return -ENODEV; 446 + } 447 + 423 448 /* Check whether or not the hardware watchdog is there */ 424 - if (!esb_getdevice() || esb_pci == NULL) 449 + if (!esb_getdevice(pdev) || esb_pci == NULL) 425 450 return -ENODEV; 426 451 427 452 /* Check that the heartbeat value is within it's range; ··· 464 467 iounmap(BASEADDR); 465 468 pci_release_region(esb_pci, 0); 466 469 pci_disable_device(esb_pci); 467 - pci_dev_put(esb_pci); 470 + esb_pci = NULL; 468 471 return ret; 469 472 } 470 473 471 - static int __devexit esb_remove(struct platform_device *dev) 474 + static void __devexit esb_remove(struct pci_dev *pdev) 472 475 { 473 476 /* Stop the timer before we leave */ 474 477 if (!nowayout) ··· 479 482 iounmap(BASEADDR); 480 483 pci_release_region(esb_pci, 0); 481 484 pci_disable_device(esb_pci); 482 - pci_dev_put(esb_pci); 483 - return 0; 485 + esb_pci = NULL; 484 486 } 485 487 486 - static void esb_shutdown(struct platform_device *dev) 488 + static void esb_shutdown(struct pci_dev *pdev) 487 489 { 488 490 esb_timer_stop(); 489 491 } 490 492 491 - static struct platform_driver esb_platform_driver = { 493 + static struct pci_driver esb_driver = { 494 + .name = ESB_MODULE_NAME, 495 + .id_table = esb_pci_tbl, 492 496 .probe = esb_probe, 493 497 .remove = __devexit_p(esb_remove), 494 498 .shutdown = esb_shutdown, 495 - .driver = { 496 - .owner = THIS_MODULE, 497 - .name = ESB_MODULE_NAME, 498 - }, 499 499 }; 500 500 501 501 static int __init watchdog_init(void) 502 502 { 503 - int err; 504 - 505 - printk(KERN_INFO PFX "Intel 6300ESB WatchDog Timer Driver v%s\n", 506 - ESB_VERSION); 507 - 508 - err = platform_driver_register(&esb_platform_driver); 509 - if (err) 510 - return err; 511 - 512 - esb_platform_device = platform_device_register_simple(ESB_MODULE_NAME, 513 - -1, NULL, 0); 514 - if (IS_ERR(esb_platform_device)) { 515 - err = PTR_ERR(esb_platform_device); 516 - goto unreg_platform_driver; 517 - } 518 - 519 - return 0; 520 - 521 - unreg_platform_driver: 522 - platform_driver_unregister(&esb_platform_driver); 523 - return err; 503 + return pci_register_driver(&esb_driver); 524 504 } 525 505 526 506 static void __exit watchdog_cleanup(void) 527 507 { 528 - platform_device_unregister(esb_platform_device); 529 - platform_driver_unregister(&esb_platform_driver); 508 + pci_unregister_driver(&esb_driver); 530 509 printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 531 510 } 532 511
+10 -11
drivers/watchdog/iTCO_wdt.c
··· 584 584 int new_heartbeat; 585 585 void __user *argp = (void __user *)arg; 586 586 int __user *p = argp; 587 - static struct watchdog_info ident = { 587 + static const struct watchdog_info ident = { 588 588 .options = WDIOF_SETTIMEOUT | 589 589 WDIOF_KEEPALIVEPING | 590 590 WDIOF_MAGICCLOSE, ··· 698 698 if (iTCO_wdt_private.iTCO_version == 2) { 699 699 pci_read_config_dword(pdev, 0xf0, &base_address); 700 700 if ((base_address & 1) == 0) { 701 - printk(KERN_ERR PFX "RCBA is disabled by harddware\n"); 701 + printk(KERN_ERR PFX "RCBA is disabled by hardware\n"); 702 702 ret = -ENODEV; 703 703 goto out; 704 704 } ··· 708 708 709 709 /* Check chipset's NO_REBOOT bit */ 710 710 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { 711 - printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, " 712 - "reboot disabled by hardware\n"); 711 + printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, " 712 + "platform may have disabled it\n"); 713 713 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ 714 714 goto out_unmap; 715 715 } ··· 805 805 806 806 static int __devinit iTCO_wdt_probe(struct platform_device *dev) 807 807 { 808 + int ret = -ENODEV; 808 809 int found = 0; 809 810 struct pci_dev *pdev = NULL; 810 811 const struct pci_device_id *ent; ··· 815 814 for_each_pci_dev(pdev) { 816 815 ent = pci_match_id(iTCO_wdt_pci_tbl, pdev); 817 816 if (ent) { 818 - if (!(iTCO_wdt_init(pdev, ent, dev))) { 819 - found++; 817 + found++; 818 + ret = iTCO_wdt_init(pdev, ent, dev); 819 + if (!ret) 820 820 break; 821 - } 822 821 } 823 822 } 824 823 825 - if (!found) { 824 + if (!found) 826 825 printk(KERN_INFO PFX "No card detected\n"); 827 - return -ENODEV; 828 - } 829 826 830 - return 0; 827 + return ret; 831 828 } 832 829 833 830 static int __devexit iTCO_wdt_remove(struct platform_device *dev)
+1 -1
drivers/watchdog/ib700wdt.c
··· 174 174 void __user *argp = (void __user *)arg; 175 175 int __user *p = argp; 176 176 177 - static struct watchdog_info ident = { 177 + static const struct watchdog_info ident = { 178 178 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT 179 179 | WDIOF_MAGICCLOSE, 180 180 .firmware_version = 1,
+1 -1
drivers/watchdog/indydog.c
··· 111 111 unsigned long arg) 112 112 { 113 113 int options, retval = -EINVAL; 114 - static struct watchdog_info ident = { 114 + static const struct watchdog_info ident = { 115 115 .options = WDIOF_KEEPALIVEPING, 116 116 .firmware_version = 0, 117 117 .identity = "Hardware Watchdog for SGI IP22",
+1 -1
drivers/watchdog/it8712f_wdt.c
··· 236 236 { 237 237 void __user *argp = (void __user *)arg; 238 238 int __user *p = argp; 239 - static struct watchdog_info ident = { 239 + static const struct watchdog_info ident = { 240 240 .identity = "IT8712F Watchdog", 241 241 .firmware_version = 1, 242 242 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
+1 -1
drivers/watchdog/it87_wdt.c
··· 421 421 return count; 422 422 } 423 423 424 - static struct watchdog_info ident = { 424 + static const struct watchdog_info ident = { 425 425 .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, 426 426 .firmware_version = 1, 427 427 .identity = WATCHDOG_NAME,
+1 -1
drivers/watchdog/ixp2000_wdt.c
··· 100 100 } 101 101 102 102 103 - static struct watchdog_info ident = { 103 + static const struct watchdog_info ident = { 104 104 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 105 105 WDIOF_KEEPALIVEPING, 106 106 .identity = "IXP2000 Watchdog",
+1 -1
drivers/watchdog/ixp4xx_wdt.c
··· 89 89 return len; 90 90 } 91 91 92 - static struct watchdog_info ident = { 92 + static const struct watchdog_info ident = { 93 93 .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | 94 94 WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 95 95 .identity = "IXP4xx Watchdog",
+1 -1
drivers/watchdog/ks8695_wdt.c
··· 145 145 return 0; 146 146 } 147 147 148 - static struct watchdog_info ks8695_wdt_info = { 148 + static const struct watchdog_info ks8695_wdt_info = { 149 149 .identity = "ks8695 watchdog", 150 150 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 151 151 };
+1 -1
drivers/watchdog/machzwd.c
··· 101 101 102 102 #define PFX "machzwd" 103 103 104 - static struct watchdog_info zf_info = { 104 + static const struct watchdog_info zf_info = { 105 105 .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 106 106 .firmware_version = 1, 107 107 .identity = "ZF-Logic watchdog",
+397
drivers/watchdog/max63xx_wdt.c
··· 1 + /* 2 + * drivers/char/watchdog/max63xx_wdt.c 3 + * 4 + * Driver for max63{69,70,71,72,73,74} watchdog timers 5 + * 6 + * Copyright (C) 2009 Marc Zyngier <maz@misterjones.org> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + * 12 + * This driver assumes the watchdog pins are memory mapped (as it is 13 + * the case for the Arcom Zeus). Should it be connected over GPIOs or 14 + * another interface, some abstraction will have to be introduced. 15 + */ 16 + 17 + #include <linux/module.h> 18 + #include <linux/moduleparam.h> 19 + #include <linux/types.h> 20 + #include <linux/kernel.h> 21 + #include <linux/fs.h> 22 + #include <linux/miscdevice.h> 23 + #include <linux/watchdog.h> 24 + #include <linux/init.h> 25 + #include <linux/bitops.h> 26 + #include <linux/platform_device.h> 27 + #include <linux/spinlock.h> 28 + #include <linux/uaccess.h> 29 + #include <linux/io.h> 30 + #include <linux/device.h> 31 + 32 + #define DEFAULT_HEARTBEAT 60 33 + #define MAX_HEARTBEAT 60 34 + 35 + static int heartbeat = DEFAULT_HEARTBEAT; 36 + static int nowayout = WATCHDOG_NOWAYOUT; 37 + 38 + /* 39 + * Memory mapping: a single byte, 3 first lower bits to select bit 3 40 + * to ping the watchdog. 41 + */ 42 + #define MAX6369_WDSET (7 << 0) 43 + #define MAX6369_WDI (1 << 3) 44 + 45 + static DEFINE_SPINLOCK(io_lock); 46 + 47 + static unsigned long wdt_status; 48 + #define WDT_IN_USE 0 49 + #define WDT_RUNNING 1 50 + #define WDT_OK_TO_CLOSE 2 51 + 52 + static int nodelay; 53 + static struct resource *wdt_mem; 54 + static void __iomem *wdt_base; 55 + static struct platform_device *max63xx_pdev; 56 + 57 + /* 58 + * The timeout values used are actually the absolute minimum the chip 59 + * offers. Typical values on my board are slightly over twice as long 60 + * (10s setting ends up with a 25s timeout), and can be up to 3 times 61 + * the nominal setting (according to the datasheet). So please take 62 + * these values with a grain of salt. Same goes for the initial delay 63 + * "feature". Only max6373/74 have a few settings without this initial 64 + * delay (selected with the "nodelay" parameter). 65 + * 66 + * I also decided to remove from the tables any timeout smaller than a 67 + * second, as it looked completly overkill... 68 + */ 69 + 70 + /* Timeouts in second */ 71 + struct max63xx_timeout { 72 + u8 wdset; 73 + u8 tdelay; 74 + u8 twd; 75 + }; 76 + 77 + static struct max63xx_timeout max6369_table[] = { 78 + { 5, 1, 1 }, 79 + { 6, 10, 10 }, 80 + { 7, 60, 60 }, 81 + { }, 82 + }; 83 + 84 + static struct max63xx_timeout max6371_table[] = { 85 + { 6, 60, 3 }, 86 + { 7, 60, 60 }, 87 + { }, 88 + }; 89 + 90 + static struct max63xx_timeout max6373_table[] = { 91 + { 2, 60, 1 }, 92 + { 5, 0, 1 }, 93 + { 1, 3, 3 }, 94 + { 7, 60, 10 }, 95 + { 6, 0, 10 }, 96 + { }, 97 + }; 98 + 99 + static struct max63xx_timeout *current_timeout; 100 + 101 + static struct max63xx_timeout * 102 + max63xx_select_timeout(struct max63xx_timeout *table, int value) 103 + { 104 + while (table->twd) { 105 + if (value <= table->twd) { 106 + if (nodelay && table->tdelay == 0) 107 + return table; 108 + 109 + if (!nodelay) 110 + return table; 111 + } 112 + 113 + table++; 114 + } 115 + 116 + return NULL; 117 + } 118 + 119 + static void max63xx_wdt_ping(void) 120 + { 121 + u8 val; 122 + 123 + spin_lock(&io_lock); 124 + 125 + val = __raw_readb(wdt_base); 126 + 127 + __raw_writeb(val | MAX6369_WDI, wdt_base); 128 + __raw_writeb(val & ~MAX6369_WDI, wdt_base); 129 + 130 + spin_unlock(&io_lock); 131 + } 132 + 133 + static void max63xx_wdt_enable(struct max63xx_timeout *entry) 134 + { 135 + u8 val; 136 + 137 + if (test_and_set_bit(WDT_RUNNING, &wdt_status)) 138 + return; 139 + 140 + spin_lock(&io_lock); 141 + 142 + val = __raw_readb(wdt_base); 143 + val &= ~MAX6369_WDSET; 144 + val |= entry->wdset; 145 + __raw_writeb(val, wdt_base); 146 + 147 + spin_unlock(&io_lock); 148 + 149 + /* check for a edge triggered startup */ 150 + if (entry->tdelay == 0) 151 + max63xx_wdt_ping(); 152 + } 153 + 154 + static void max63xx_wdt_disable(void) 155 + { 156 + spin_lock(&io_lock); 157 + 158 + __raw_writeb(3, wdt_base); 159 + 160 + spin_unlock(&io_lock); 161 + 162 + clear_bit(WDT_RUNNING, &wdt_status); 163 + } 164 + 165 + static int max63xx_wdt_open(struct inode *inode, struct file *file) 166 + { 167 + if (test_and_set_bit(WDT_IN_USE, &wdt_status)) 168 + return -EBUSY; 169 + 170 + max63xx_wdt_enable(current_timeout); 171 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 172 + 173 + return nonseekable_open(inode, file); 174 + } 175 + 176 + static ssize_t max63xx_wdt_write(struct file *file, const char *data, 177 + size_t len, loff_t *ppos) 178 + { 179 + if (len) { 180 + if (!nowayout) { 181 + size_t i; 182 + 183 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 184 + for (i = 0; i != len; i++) { 185 + char c; 186 + 187 + if (get_user(c, data + i)) 188 + return -EFAULT; 189 + 190 + if (c == 'V') 191 + set_bit(WDT_OK_TO_CLOSE, &wdt_status); 192 + } 193 + } 194 + 195 + max63xx_wdt_ping(); 196 + } 197 + 198 + return len; 199 + } 200 + 201 + static const struct watchdog_info ident = { 202 + .options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, 203 + .identity = "max63xx Watchdog", 204 + }; 205 + 206 + static long max63xx_wdt_ioctl(struct file *file, unsigned int cmd, 207 + unsigned long arg) 208 + { 209 + int ret = -ENOTTY; 210 + 211 + switch (cmd) { 212 + case WDIOC_GETSUPPORT: 213 + ret = copy_to_user((struct watchdog_info *)arg, &ident, 214 + sizeof(ident)) ? -EFAULT : 0; 215 + break; 216 + 217 + case WDIOC_GETSTATUS: 218 + case WDIOC_GETBOOTSTATUS: 219 + ret = put_user(0, (int *)arg); 220 + break; 221 + 222 + case WDIOC_KEEPALIVE: 223 + max63xx_wdt_ping(); 224 + ret = 0; 225 + break; 226 + 227 + case WDIOC_GETTIMEOUT: 228 + ret = put_user(heartbeat, (int *)arg); 229 + break; 230 + } 231 + return ret; 232 + } 233 + 234 + static int max63xx_wdt_release(struct inode *inode, struct file *file) 235 + { 236 + if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 237 + max63xx_wdt_disable(); 238 + else 239 + dev_crit(&max63xx_pdev->dev, 240 + "device closed unexpectedly - timer will not stop\n"); 241 + 242 + clear_bit(WDT_IN_USE, &wdt_status); 243 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 244 + 245 + return 0; 246 + } 247 + 248 + static const struct file_operations max63xx_wdt_fops = { 249 + .owner = THIS_MODULE, 250 + .llseek = no_llseek, 251 + .write = max63xx_wdt_write, 252 + .unlocked_ioctl = max63xx_wdt_ioctl, 253 + .open = max63xx_wdt_open, 254 + .release = max63xx_wdt_release, 255 + }; 256 + 257 + static struct miscdevice max63xx_wdt_miscdev = { 258 + .minor = WATCHDOG_MINOR, 259 + .name = "watchdog", 260 + .fops = &max63xx_wdt_fops, 261 + }; 262 + 263 + static int __devinit max63xx_wdt_probe(struct platform_device *pdev) 264 + { 265 + int ret = 0; 266 + int size; 267 + struct resource *res; 268 + struct device *dev = &pdev->dev; 269 + struct max63xx_timeout *table; 270 + 271 + table = (struct max63xx_timeout *)pdev->id_entry->driver_data; 272 + 273 + if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) 274 + heartbeat = DEFAULT_HEARTBEAT; 275 + 276 + dev_info(dev, "requesting %ds heartbeat\n", heartbeat); 277 + current_timeout = max63xx_select_timeout(table, heartbeat); 278 + 279 + if (!current_timeout) { 280 + dev_err(dev, "unable to satisfy heartbeat request\n"); 281 + return -EINVAL; 282 + } 283 + 284 + dev_info(dev, "using %ds heartbeat with %ds initial delay\n", 285 + current_timeout->twd, current_timeout->tdelay); 286 + 287 + heartbeat = current_timeout->twd; 288 + 289 + max63xx_pdev = pdev; 290 + 291 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 292 + if (res == NULL) { 293 + dev_err(dev, "failed to get memory region resource\n"); 294 + return -ENOENT; 295 + } 296 + 297 + size = resource_size(res); 298 + wdt_mem = request_mem_region(res->start, size, pdev->name); 299 + 300 + if (wdt_mem == NULL) { 301 + dev_err(dev, "failed to get memory region\n"); 302 + return -ENOENT; 303 + } 304 + 305 + wdt_base = ioremap(res->start, size); 306 + if (!wdt_base) { 307 + dev_err(dev, "failed to map memory region\n"); 308 + ret = -ENOMEM; 309 + goto out_request; 310 + } 311 + 312 + ret = misc_register(&max63xx_wdt_miscdev); 313 + if (ret < 0) { 314 + dev_err(dev, "cannot register misc device\n"); 315 + goto out_unmap; 316 + } 317 + 318 + return 0; 319 + 320 + out_unmap: 321 + iounmap(wdt_base); 322 + out_request: 323 + release_resource(wdt_mem); 324 + kfree(wdt_mem); 325 + 326 + return ret; 327 + } 328 + 329 + static int __devexit max63xx_wdt_remove(struct platform_device *pdev) 330 + { 331 + misc_deregister(&max63xx_wdt_miscdev); 332 + if (wdt_mem) { 333 + release_resource(wdt_mem); 334 + kfree(wdt_mem); 335 + wdt_mem = NULL; 336 + } 337 + 338 + if (wdt_base) 339 + iounmap(wdt_base); 340 + 341 + return 0; 342 + } 343 + 344 + static struct platform_device_id max63xx_id_table[] = { 345 + { "max6369_wdt", (kernel_ulong_t)max6369_table, }, 346 + { "max6370_wdt", (kernel_ulong_t)max6369_table, }, 347 + { "max6371_wdt", (kernel_ulong_t)max6371_table, }, 348 + { "max6372_wdt", (kernel_ulong_t)max6371_table, }, 349 + { "max6373_wdt", (kernel_ulong_t)max6373_table, }, 350 + { "max6374_wdt", (kernel_ulong_t)max6373_table, }, 351 + { }, 352 + }; 353 + MODULE_DEVICE_TABLE(platform, max63xx_id_table); 354 + 355 + static struct platform_driver max63xx_wdt_driver = { 356 + .probe = max63xx_wdt_probe, 357 + .remove = __devexit_p(max63xx_wdt_remove), 358 + .id_table = max63xx_id_table, 359 + .driver = { 360 + .name = "max63xx_wdt", 361 + .owner = THIS_MODULE, 362 + }, 363 + }; 364 + 365 + static int __init max63xx_wdt_init(void) 366 + { 367 + return platform_driver_register(&max63xx_wdt_driver); 368 + } 369 + 370 + static void __exit max63xx_wdt_exit(void) 371 + { 372 + platform_driver_unregister(&max63xx_wdt_driver); 373 + } 374 + 375 + module_init(max63xx_wdt_init); 376 + module_exit(max63xx_wdt_exit); 377 + 378 + MODULE_AUTHOR("Marc Zyngier <maz@misterjones.org>"); 379 + MODULE_DESCRIPTION("max63xx Watchdog Driver"); 380 + 381 + module_param(heartbeat, int, 0); 382 + MODULE_PARM_DESC(heartbeat, 383 + "Watchdog heartbeat period in seconds from 1 to " 384 + __MODULE_STRING(MAX_HEARTBEAT) ", default " 385 + __MODULE_STRING(DEFAULT_HEARTBEAT)); 386 + 387 + module_param(nowayout, int, 0); 388 + MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" 389 + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 390 + 391 + module_param(nodelay, int, 0); 392 + MODULE_PARM_DESC(nodelay, 393 + "Force selection of a timeout setting without initial delay " 394 + "(max6373/74 only, default=0)"); 395 + 396 + MODULE_LICENSE("GPL"); 397 + MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+1 -1
drivers/watchdog/mixcomwd.c
··· 201 201 void __user *argp = (void __user *)arg; 202 202 int __user *p = argp; 203 203 int status; 204 - static struct watchdog_info ident = { 204 + static const struct watchdog_info ident = { 205 205 .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 206 206 .firmware_version = 1, 207 207 .identity = "MixCOM watchdog",
+1 -1
drivers/watchdog/mpc8xxx_wdt.c
··· 148 148 { 149 149 void __user *argp = (void __user *)arg; 150 150 int __user *p = argp; 151 - static struct watchdog_info ident = { 151 + static const struct watchdog_info ident = { 152 152 .options = WDIOF_KEEPALIVEPING, 153 153 .firmware_version = 1, 154 154 .identity = "MPC8xxx",
+1 -1
drivers/watchdog/mpcore_wdt.c
··· 213 213 return len; 214 214 } 215 215 216 - static struct watchdog_info ident = { 216 + static const struct watchdog_info ident = { 217 217 .options = WDIOF_SETTIMEOUT | 218 218 WDIOF_KEEPALIVEPING | 219 219 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/mv64x60_wdt.c
··· 179 179 int timeout; 180 180 int options; 181 181 void __user *argp = (void __user *)arg; 182 - static struct watchdog_info info = { 182 + static const struct watchdog_info info = { 183 183 .options = WDIOF_SETTIMEOUT | 184 184 WDIOF_MAGICCLOSE | 185 185 WDIOF_KEEPALIVEPING,
+1 -1
drivers/watchdog/pc87413_wdt.c
··· 407 407 int __user *i; 408 408 } uarg; 409 409 410 - static struct watchdog_info ident = { 410 + static const struct watchdog_info ident = { 411 411 .options = WDIOF_KEEPALIVEPING | 412 412 WDIOF_SETTIMEOUT | 413 413 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/pcwd.c
··· 606 606 int temperature; 607 607 int new_heartbeat; 608 608 int __user *argp = (int __user *)arg; 609 - static struct watchdog_info ident = { 609 + static const struct watchdog_info ident = { 610 610 .options = WDIOF_OVERHEAT | 611 611 WDIOF_CARDRESET | 612 612 WDIOF_KEEPALIVEPING |
+1 -1
drivers/watchdog/pcwd_pci.c
··· 481 481 { 482 482 void __user *argp = (void __user *)arg; 483 483 int __user *p = argp; 484 - static struct watchdog_info ident = { 484 + static const struct watchdog_info ident = { 485 485 .options = WDIOF_OVERHEAT | 486 486 WDIOF_CARDRESET | 487 487 WDIOF_KEEPALIVEPING |
+1 -1
drivers/watchdog/pcwd_usb.c
··· 404 404 { 405 405 void __user *argp = (void __user *)arg; 406 406 int __user *p = argp; 407 - static struct watchdog_info ident = { 407 + static const struct watchdog_info ident = { 408 408 .options = WDIOF_KEEPALIVEPING | 409 409 WDIOF_SETTIMEOUT | 410 410 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/pika_wdt.c
··· 52 52 struct timer_list timer; /* The timer that pings the watchdog */ 53 53 } pikawdt_private; 54 54 55 - static struct watchdog_info ident = { 55 + static const struct watchdog_info ident = { 56 56 .identity = DRV_NAME, 57 57 .options = WDIOF_CARDRESET | 58 58 WDIOF_SETTIMEOUT |
+1 -1
drivers/watchdog/pnx833x_wdt.c
··· 141 141 int options, new_timeout = 0; 142 142 uint32_t timeout, timeout_left = 0; 143 143 144 - static struct watchdog_info ident = { 144 + static const struct watchdog_info ident = { 145 145 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT, 146 146 .firmware_version = 0, 147 147 .identity = "Hardware Watchdog for PNX833x",
+1 -1
drivers/watchdog/rc32434_wdt.c
··· 198 198 void __user *argp = (void __user *)arg; 199 199 int new_timeout; 200 200 unsigned int value; 201 - static struct watchdog_info ident = { 201 + static const struct watchdog_info ident = { 202 202 .options = WDIOF_SETTIMEOUT | 203 203 WDIOF_KEEPALIVEPING | 204 204 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/rdc321x_wdt.c
··· 149 149 { 150 150 void __user *argp = (void __user *)arg; 151 151 unsigned int value; 152 - static struct watchdog_info ident = { 152 + static const struct watchdog_info ident = { 153 153 .options = WDIOF_CARDRESET, 154 154 .identity = "RDC321x WDT", 155 155 };
+1 -1
drivers/watchdog/riowd.c
··· 85 85 86 86 static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 87 87 { 88 - static struct watchdog_info info = { 88 + static const struct watchdog_info info = { 89 89 .options = WDIOF_SETTIMEOUT, 90 90 .firmware_version = 1, 91 91 .identity = DRIVER_NAME,
+1 -1
drivers/watchdog/sbc_fitpc2_wdt.c
··· 111 111 } 112 112 113 113 114 - static struct watchdog_info ident = { 114 + static const struct watchdog_info ident = { 115 115 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 116 116 WDIOF_KEEPALIVEPING, 117 117 .identity = WATCHDOG_NAME,
+1 -1
drivers/watchdog/sch311x_wdt.c
··· 250 250 int new_timeout; 251 251 void __user *argp = (void __user *)arg; 252 252 int __user *p = argp; 253 - static struct watchdog_info ident = { 253 + static const struct watchdog_info ident = { 254 254 .options = WDIOF_KEEPALIVEPING | 255 255 WDIOF_SETTIMEOUT | 256 256 WDIOF_MAGICCLOSE,
+1 -1
drivers/watchdog/stmp3xxx_wdt.c
··· 94 94 return len; 95 95 } 96 96 97 - static struct watchdog_info ident = { 97 + static const struct watchdog_info ident = { 98 98 .options = WDIOF_CARDRESET | 99 99 WDIOF_MAGICCLOSE | 100 100 WDIOF_SETTIMEOUT |
+520
drivers/watchdog/ts72xx_wdt.c
··· 1 + /* 2 + * Watchdog driver for Technologic Systems TS-72xx based SBCs 3 + * (TS-7200, TS-7250 and TS-7260). These boards have external 4 + * glue logic CPLD chip, which includes programmable watchdog 5 + * timer. 6 + * 7 + * Copyright (c) 2009 Mika Westerberg <mika.westerberg@iki.fi> 8 + * 9 + * This driver is based on ep93xx_wdt and wm831x_wdt drivers. 10 + * 11 + * This file is licensed under the terms of the GNU General Public 12 + * License version 2. This program is licensed "as is" without any 13 + * warranty of any kind, whether express or implied. 14 + */ 15 + 16 + #include <linux/fs.h> 17 + #include <linux/io.h> 18 + #include <linux/module.h> 19 + #include <linux/moduleparam.h> 20 + #include <linux/miscdevice.h> 21 + #include <linux/mutex.h> 22 + #include <linux/platform_device.h> 23 + #include <linux/watchdog.h> 24 + #include <linux/uaccess.h> 25 + 26 + #define TS72XX_WDT_FEED_VAL 0x05 27 + #define TS72XX_WDT_DEFAULT_TIMEOUT 8 28 + 29 + static int timeout = TS72XX_WDT_DEFAULT_TIMEOUT; 30 + module_param(timeout, int, 0); 31 + MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. " 32 + "(1 <= timeout <= 8, default=" 33 + __MODULE_STRING(TS72XX_WDT_DEFAULT_TIMEOUT) 34 + ")"); 35 + 36 + static int nowayout = WATCHDOG_NOWAYOUT; 37 + module_param(nowayout, int, 0); 38 + MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); 39 + 40 + /** 41 + * struct ts72xx_wdt - watchdog control structure 42 + * @lock: lock that protects this structure 43 + * @regval: watchdog timeout value suitable for control register 44 + * @flags: flags controlling watchdog device state 45 + * @control_reg: watchdog control register 46 + * @feed_reg: watchdog feed register 47 + * @pdev: back pointer to platform dev 48 + */ 49 + struct ts72xx_wdt { 50 + struct mutex lock; 51 + int regval; 52 + 53 + #define TS72XX_WDT_BUSY_FLAG 1 54 + #define TS72XX_WDT_EXPECT_CLOSE_FLAG 2 55 + int flags; 56 + 57 + void __iomem *control_reg; 58 + void __iomem *feed_reg; 59 + 60 + struct platform_device *pdev; 61 + }; 62 + 63 + struct platform_device *ts72xx_wdt_pdev; 64 + 65 + /* 66 + * TS-72xx Watchdog supports following timeouts (value written 67 + * to control register): 68 + * value description 69 + * ------------------------- 70 + * 0x00 watchdog disabled 71 + * 0x01 250ms 72 + * 0x02 500ms 73 + * 0x03 1s 74 + * 0x04 reserved 75 + * 0x05 2s 76 + * 0x06 4s 77 + * 0x07 8s 78 + * 79 + * Timeouts below 1s are not very usable so we don't 80 + * allow them at all. 81 + * 82 + * We provide two functions that convert between these: 83 + * timeout_to_regval() and regval_to_timeout(). 84 + */ 85 + static const struct { 86 + int timeout; 87 + int regval; 88 + } ts72xx_wdt_map[] = { 89 + { 1, 3 }, 90 + { 2, 5 }, 91 + { 4, 6 }, 92 + { 8, 7 }, 93 + }; 94 + 95 + /** 96 + * timeout_to_regval() - converts given timeout to control register value 97 + * @new_timeout: timeout in seconds to be converted 98 + * 99 + * Function converts given @new_timeout into valid value that can 100 + * be programmed into watchdog control register. When conversion is 101 + * not possible, function returns %-EINVAL. 102 + */ 103 + static int timeout_to_regval(int new_timeout) 104 + { 105 + int i; 106 + 107 + /* first limit it to 1 - 8 seconds */ 108 + new_timeout = clamp_val(new_timeout, 1, 8); 109 + 110 + for (i = 0; i < ARRAY_SIZE(ts72xx_wdt_map); i++) { 111 + if (ts72xx_wdt_map[i].timeout >= new_timeout) 112 + return ts72xx_wdt_map[i].regval; 113 + } 114 + 115 + return -EINVAL; 116 + } 117 + 118 + /** 119 + * regval_to_timeout() - converts control register value to timeout 120 + * @regval: control register value to be converted 121 + * 122 + * Function converts given @regval to timeout in seconds (1, 2, 4 or 8). 123 + * If @regval cannot be converted, function returns %-EINVAL. 124 + */ 125 + static int regval_to_timeout(int regval) 126 + { 127 + int i; 128 + 129 + for (i = 0; i < ARRAY_SIZE(ts72xx_wdt_map); i++) { 130 + if (ts72xx_wdt_map[i].regval == regval) 131 + return ts72xx_wdt_map[i].timeout; 132 + } 133 + 134 + return -EINVAL; 135 + } 136 + 137 + /** 138 + * ts72xx_wdt_kick() - kick the watchdog 139 + * @wdt: watchdog to be kicked 140 + * 141 + * Called with @wdt->lock held. 142 + */ 143 + static inline void ts72xx_wdt_kick(struct ts72xx_wdt *wdt) 144 + { 145 + __raw_writeb(TS72XX_WDT_FEED_VAL, wdt->feed_reg); 146 + } 147 + 148 + /** 149 + * ts72xx_wdt_start() - starts the watchdog timer 150 + * @wdt: watchdog to be started 151 + * 152 + * This function programs timeout to watchdog timer 153 + * and starts it. 154 + * 155 + * Called with @wdt->lock held. 156 + */ 157 + static void ts72xx_wdt_start(struct ts72xx_wdt *wdt) 158 + { 159 + /* 160 + * To program the wdt, it first must be "fed" and 161 + * only after that (within 30 usecs) the configuration 162 + * can be changed. 163 + */ 164 + ts72xx_wdt_kick(wdt); 165 + __raw_writeb((u8)wdt->regval, wdt->control_reg); 166 + } 167 + 168 + /** 169 + * ts72xx_wdt_stop() - stops the watchdog timer 170 + * @wdt: watchdog to be stopped 171 + * 172 + * Called with @wdt->lock held. 173 + */ 174 + static void ts72xx_wdt_stop(struct ts72xx_wdt *wdt) 175 + { 176 + ts72xx_wdt_kick(wdt); 177 + __raw_writeb(0, wdt->control_reg); 178 + } 179 + 180 + static int ts72xx_wdt_open(struct inode *inode, struct file *file) 181 + { 182 + struct ts72xx_wdt *wdt = platform_get_drvdata(ts72xx_wdt_pdev); 183 + int regval; 184 + 185 + /* 186 + * Try to convert default timeout to valid register 187 + * value first. 188 + */ 189 + regval = timeout_to_regval(timeout); 190 + if (regval < 0) { 191 + dev_err(&wdt->pdev->dev, 192 + "failed to convert timeout (%d) to register value\n", 193 + timeout); 194 + return -EINVAL; 195 + } 196 + 197 + if (mutex_lock_interruptible(&wdt->lock)) 198 + return -ERESTARTSYS; 199 + 200 + if ((wdt->flags & TS72XX_WDT_BUSY_FLAG) != 0) { 201 + mutex_unlock(&wdt->lock); 202 + return -EBUSY; 203 + } 204 + 205 + wdt->flags = TS72XX_WDT_BUSY_FLAG; 206 + wdt->regval = regval; 207 + file->private_data = wdt; 208 + 209 + ts72xx_wdt_start(wdt); 210 + 211 + mutex_unlock(&wdt->lock); 212 + return nonseekable_open(inode, file); 213 + } 214 + 215 + static int ts72xx_wdt_release(struct inode *inode, struct file *file) 216 + { 217 + struct ts72xx_wdt *wdt = file->private_data; 218 + 219 + if (mutex_lock_interruptible(&wdt->lock)) 220 + return -ERESTARTSYS; 221 + 222 + if ((wdt->flags & TS72XX_WDT_EXPECT_CLOSE_FLAG) != 0) { 223 + ts72xx_wdt_stop(wdt); 224 + } else { 225 + dev_warn(&wdt->pdev->dev, 226 + "TS-72XX WDT device closed unexpectly. " 227 + "Watchdog timer will not stop!\n"); 228 + /* 229 + * Kick it one more time, to give userland some time 230 + * to recover (for example, respawning the kicker 231 + * daemon). 232 + */ 233 + ts72xx_wdt_kick(wdt); 234 + } 235 + 236 + wdt->flags = 0; 237 + 238 + mutex_unlock(&wdt->lock); 239 + return 0; 240 + } 241 + 242 + static ssize_t ts72xx_wdt_write(struct file *file, 243 + const char __user *data, 244 + size_t len, 245 + loff_t *ppos) 246 + { 247 + struct ts72xx_wdt *wdt = file->private_data; 248 + 249 + if (!len) 250 + return 0; 251 + 252 + if (mutex_lock_interruptible(&wdt->lock)) 253 + return -ERESTARTSYS; 254 + 255 + ts72xx_wdt_kick(wdt); 256 + 257 + /* 258 + * Support for magic character closing. User process 259 + * writes 'V' into the device, just before it is closed. 260 + * This means that we know that the wdt timer can be 261 + * stopped after user closes the device. 262 + */ 263 + if (!nowayout) { 264 + int i; 265 + 266 + for (i = 0; i < len; i++) { 267 + char c; 268 + 269 + /* In case it was set long ago */ 270 + wdt->flags &= ~TS72XX_WDT_EXPECT_CLOSE_FLAG; 271 + 272 + if (get_user(c, data + i)) { 273 + mutex_unlock(&wdt->lock); 274 + return -EFAULT; 275 + } 276 + if (c == 'V') { 277 + wdt->flags |= TS72XX_WDT_EXPECT_CLOSE_FLAG; 278 + break; 279 + } 280 + } 281 + } 282 + 283 + mutex_unlock(&wdt->lock); 284 + return len; 285 + } 286 + 287 + static const struct watchdog_info winfo = { 288 + .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | 289 + WDIOF_MAGICCLOSE, 290 + .firmware_version = 1, 291 + .identity = "TS-72XX WDT", 292 + }; 293 + 294 + static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, 295 + unsigned long arg) 296 + { 297 + struct ts72xx_wdt *wdt = file->private_data; 298 + void __user *argp = (void __user *)arg; 299 + int __user *p = (int __user *)argp; 300 + int error = 0; 301 + 302 + if (mutex_lock_interruptible(&wdt->lock)) 303 + return -ERESTARTSYS; 304 + 305 + switch (cmd) { 306 + case WDIOC_GETSUPPORT: 307 + error = copy_to_user(argp, &winfo, sizeof(winfo)); 308 + break; 309 + 310 + case WDIOC_GETSTATUS: 311 + case WDIOC_GETBOOTSTATUS: 312 + return put_user(0, p); 313 + 314 + case WDIOC_KEEPALIVE: 315 + ts72xx_wdt_kick(wdt); 316 + break; 317 + 318 + case WDIOC_SETOPTIONS: { 319 + int options; 320 + 321 + if (get_user(options, p)) { 322 + error = -EFAULT; 323 + break; 324 + } 325 + 326 + error = -EINVAL; 327 + 328 + if ((options & WDIOS_DISABLECARD) != 0) { 329 + ts72xx_wdt_stop(wdt); 330 + error = 0; 331 + } 332 + if ((options & WDIOS_ENABLECARD) != 0) { 333 + ts72xx_wdt_start(wdt); 334 + error = 0; 335 + } 336 + 337 + break; 338 + } 339 + 340 + case WDIOC_SETTIMEOUT: { 341 + int new_timeout; 342 + 343 + if (get_user(new_timeout, p)) { 344 + error = -EFAULT; 345 + } else { 346 + int regval; 347 + 348 + regval = timeout_to_regval(new_timeout); 349 + if (regval < 0) { 350 + error = -EINVAL; 351 + } else { 352 + ts72xx_wdt_stop(wdt); 353 + wdt->regval = regval; 354 + ts72xx_wdt_start(wdt); 355 + } 356 + } 357 + if (error) 358 + break; 359 + 360 + /*FALLTHROUGH*/ 361 + } 362 + 363 + case WDIOC_GETTIMEOUT: 364 + if (put_user(regval_to_timeout(wdt->regval), p)) 365 + error = -EFAULT; 366 + break; 367 + 368 + default: 369 + error = -ENOTTY; 370 + break; 371 + } 372 + 373 + mutex_unlock(&wdt->lock); 374 + return error; 375 + } 376 + 377 + static const struct file_operations ts72xx_wdt_fops = { 378 + .owner = THIS_MODULE, 379 + .llseek = no_llseek, 380 + .open = ts72xx_wdt_open, 381 + .release = ts72xx_wdt_release, 382 + .write = ts72xx_wdt_write, 383 + .unlocked_ioctl = ts72xx_wdt_ioctl, 384 + }; 385 + 386 + static struct miscdevice ts72xx_wdt_miscdev = { 387 + .minor = WATCHDOG_MINOR, 388 + .name = "watchdog", 389 + .fops = &ts72xx_wdt_fops, 390 + }; 391 + 392 + static __devinit int ts72xx_wdt_probe(struct platform_device *pdev) 393 + { 394 + struct ts72xx_wdt *wdt; 395 + struct resource *r1, *r2; 396 + int error = 0; 397 + 398 + wdt = kzalloc(sizeof(struct ts72xx_wdt), GFP_KERNEL); 399 + if (!wdt) { 400 + dev_err(&pdev->dev, "failed to allocate memory\n"); 401 + return -ENOMEM; 402 + } 403 + 404 + r1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); 405 + if (!r1) { 406 + dev_err(&pdev->dev, "failed to get memory resource\n"); 407 + error = -ENODEV; 408 + goto fail; 409 + } 410 + 411 + r1 = request_mem_region(r1->start, resource_size(r1), pdev->name); 412 + if (!r1) { 413 + dev_err(&pdev->dev, "cannot request memory region\n"); 414 + error = -EBUSY; 415 + goto fail; 416 + } 417 + 418 + wdt->control_reg = ioremap(r1->start, resource_size(r1)); 419 + if (!wdt->control_reg) { 420 + dev_err(&pdev->dev, "failed to map memory\n"); 421 + error = -ENODEV; 422 + goto fail_free_control; 423 + } 424 + 425 + r2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); 426 + if (!r2) { 427 + dev_err(&pdev->dev, "failed to get memory resource\n"); 428 + error = -ENODEV; 429 + goto fail_unmap_control; 430 + } 431 + 432 + r2 = request_mem_region(r2->start, resource_size(r2), pdev->name); 433 + if (!r2) { 434 + dev_err(&pdev->dev, "cannot request memory region\n"); 435 + error = -EBUSY; 436 + goto fail_unmap_control; 437 + } 438 + 439 + wdt->feed_reg = ioremap(r2->start, resource_size(r2)); 440 + if (!wdt->feed_reg) { 441 + dev_err(&pdev->dev, "failed to map memory\n"); 442 + error = -ENODEV; 443 + goto fail_free_feed; 444 + } 445 + 446 + platform_set_drvdata(pdev, wdt); 447 + ts72xx_wdt_pdev = pdev; 448 + wdt->pdev = pdev; 449 + mutex_init(&wdt->lock); 450 + 451 + error = misc_register(&ts72xx_wdt_miscdev); 452 + if (error) { 453 + dev_err(&pdev->dev, "failed to register miscdev\n"); 454 + goto fail_unmap_feed; 455 + } 456 + 457 + dev_info(&pdev->dev, "TS-72xx Watchdog driver\n"); 458 + 459 + return 0; 460 + 461 + fail_unmap_feed: 462 + platform_set_drvdata(pdev, NULL); 463 + iounmap(wdt->feed_reg); 464 + fail_free_feed: 465 + release_mem_region(r2->start, resource_size(r2)); 466 + fail_unmap_control: 467 + iounmap(wdt->control_reg); 468 + fail_free_control: 469 + release_mem_region(r1->start, resource_size(r1)); 470 + fail: 471 + kfree(wdt); 472 + return error; 473 + } 474 + 475 + static __devexit int ts72xx_wdt_remove(struct platform_device *pdev) 476 + { 477 + struct ts72xx_wdt *wdt = platform_get_drvdata(pdev); 478 + struct resource *res; 479 + int error; 480 + 481 + error = misc_deregister(&ts72xx_wdt_miscdev); 482 + platform_set_drvdata(pdev, NULL); 483 + 484 + iounmap(wdt->feed_reg); 485 + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 486 + release_mem_region(res->start, resource_size(res)); 487 + 488 + iounmap(wdt->control_reg); 489 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 490 + release_mem_region(res->start, resource_size(res)); 491 + 492 + kfree(wdt); 493 + return error; 494 + } 495 + 496 + static struct platform_driver ts72xx_wdt_driver = { 497 + .probe = ts72xx_wdt_probe, 498 + .remove = __devexit_p(ts72xx_wdt_remove), 499 + .driver = { 500 + .name = "ts72xx-wdt", 501 + .owner = THIS_MODULE, 502 + }, 503 + }; 504 + 505 + static __init int ts72xx_wdt_init(void) 506 + { 507 + return platform_driver_register(&ts72xx_wdt_driver); 508 + } 509 + module_init(ts72xx_wdt_init); 510 + 511 + static __exit void ts72xx_wdt_exit(void) 512 + { 513 + platform_driver_unregister(&ts72xx_wdt_driver); 514 + } 515 + module_exit(ts72xx_wdt_exit); 516 + 517 + MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>"); 518 + MODULE_DESCRIPTION("TS-72xx SBC Watchdog"); 519 + MODULE_LICENSE("GPL"); 520 + MODULE_ALIAS("platform:ts72xx-wdt");
+6 -19
drivers/watchdog/txx9wdt.c
··· 13 13 #include <linux/miscdevice.h> 14 14 #include <linux/watchdog.h> 15 15 #include <linux/fs.h> 16 - #include <linux/reboot.h> 17 16 #include <linux/init.h> 18 17 #include <linux/uaccess.h> 19 18 #include <linux/platform_device.h> ··· 165 166 } 166 167 } 167 168 168 - static int txx9wdt_notify_sys(struct notifier_block *this, unsigned long code, 169 - void *unused) 170 - { 171 - if (code == SYS_DOWN || code == SYS_HALT) 172 - txx9wdt_stop(); 173 - return NOTIFY_DONE; 174 - } 175 - 176 169 static const struct file_operations txx9wdt_fops = { 177 170 .owner = THIS_MODULE, 178 171 .llseek = no_llseek, ··· 178 187 .minor = WATCHDOG_MINOR, 179 188 .name = "watchdog", 180 189 .fops = &txx9wdt_fops, 181 - }; 182 - 183 - static struct notifier_block txx9wdt_notifier = { 184 - .notifier_call = txx9wdt_notify_sys, 185 190 }; 186 191 187 192 static int __init txx9wdt_probe(struct platform_device *dev) ··· 208 221 if (!txx9wdt_reg) 209 222 goto exit_busy; 210 223 211 - ret = register_reboot_notifier(&txx9wdt_notifier); 212 - if (ret) 213 - goto exit; 214 - 215 224 ret = misc_register(&txx9wdt_miscdev); 216 225 if (ret) { 217 - unregister_reboot_notifier(&txx9wdt_notifier); 218 226 goto exit; 219 227 } 220 228 ··· 231 249 static int __exit txx9wdt_remove(struct platform_device *dev) 232 250 { 233 251 misc_deregister(&txx9wdt_miscdev); 234 - unregister_reboot_notifier(&txx9wdt_notifier); 235 252 clk_disable(txx9_imclk); 236 253 clk_put(txx9_imclk); 237 254 return 0; 238 255 } 239 256 257 + static void txx9wdt_shutdown(struct platform_device *dev) 258 + { 259 + txx9wdt_stop(); 260 + } 261 + 240 262 static struct platform_driver txx9wdt_driver = { 241 263 .remove = __exit_p(txx9wdt_remove), 264 + .shutdown = txx9wdt_shutdown, 242 265 .driver = { 243 266 .name = "txx9wdt", 244 267 .owner = THIS_MODULE,
+1 -1
drivers/watchdog/w83627hf_wdt.c
··· 201 201 void __user *argp = (void __user *)arg; 202 202 int __user *p = argp; 203 203 int new_timeout; 204 - static struct watchdog_info ident = { 204 + static const struct watchdog_info ident = { 205 205 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | 206 206 WDIOF_MAGICCLOSE, 207 207 .firmware_version = 1,
+1 -1
drivers/watchdog/w83977f_wdt.c
··· 371 371 * according to their available features. 372 372 */ 373 373 374 - static struct watchdog_info ident = { 374 + static const struct watchdog_info ident = { 375 375 .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, 376 376 .firmware_version = 1, 377 377 .identity = WATCHDOG_NAME,
+1 -1
drivers/watchdog/wdrtas.c
··· 312 312 { 313 313 int __user *argp = (void __user *)arg; 314 314 int i; 315 - static struct watchdog_info wdinfo = { 315 + static const struct watchdog_info wdinfo = { 316 316 .options = WDRTAS_SUPPORTED_MASK, 317 317 .firmware_version = 0, 318 318 .identity = "wdrtas",
+1 -1
drivers/watchdog/wdt.c
··· 358 358 int new_heartbeat; 359 359 int status; 360 360 361 - static struct watchdog_info ident = { 361 + struct watchdog_info ident = { 362 362 .options = WDIOF_SETTIMEOUT| 363 363 WDIOF_MAGICCLOSE| 364 364 WDIOF_KEEPALIVEPING,
+1 -1
drivers/watchdog/wdt_pci.c
··· 412 412 int new_heartbeat; 413 413 int status; 414 414 415 - static struct watchdog_info ident = { 415 + struct watchdog_info ident = { 416 416 .options = WDIOF_SETTIMEOUT| 417 417 WDIOF_MAGICCLOSE| 418 418 WDIOF_KEEPALIVEPING,
+1 -1
drivers/watchdog/wm831x_wdt.c
··· 213 213 return count; 214 214 } 215 215 216 - static struct watchdog_info ident = { 216 + static const struct watchdog_info ident = { 217 217 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 218 218 .identity = "WM831x Watchdog", 219 219 };
+1 -1
drivers/watchdog/wm8350_wdt.c
··· 177 177 return count; 178 178 } 179 179 180 - static struct watchdog_info ident = { 180 + static const struct watchdog_info ident = { 181 181 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 182 182 .identity = "WM8350 Watchdog", 183 183 };