diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2012-05-04 14:43:25 +0200 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-05-23 16:23:53 +0200 |
commit | 5ce9c371c788638890980b27f0cd8af7071b3a50 (patch) | |
tree | 948f891f9211d61631199bdefb2d8adb44f951f4 /drivers/watchdog/via_wdt.c | |
parent | 8f90a3ae8f67a6c521e2d8fcb488262833f2a4cd (diff) |
watchdog: Use module_pci_driver
This patch converts the PCI watchdog drivers so that they use the
module_pci_driver() macro. This makes the code smaller and simpler.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: Thomas Mingarelli <thomas.mingarelli@hp.com>
Cc: Marc Vertes <marc.vertes@sigfox.com>
Diffstat (limited to 'drivers/watchdog/via_wdt.c')
-rw-r--r-- | drivers/watchdog/via_wdt.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index 465e08273c9..5603e31afda 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c @@ -202,6 +202,9 @@ static int __devinit wdt_probe(struct pci_dev *pdev, goto err_out_release; } + if (timeout < 1 || timeout > WDT_TIMEOUT_MAX) + timeout = WDT_TIMEOUT; + wdt_dev.timeout = timeout; watchdog_set_nowayout(&wdt_dev, nowayout); if (readl(wdt_mem) & VIA_WDT_FIRED) @@ -250,20 +253,7 @@ static struct pci_driver wdt_driver = { .remove = __devexit_p(wdt_remove), }; -static int __init wdt_init(void) -{ - if (timeout < 1 || timeout > WDT_TIMEOUT_MAX) - timeout = WDT_TIMEOUT; - return pci_register_driver(&wdt_driver); -} - -static void __exit wdt_exit(void) -{ - pci_unregister_driver(&wdt_driver); -} - -module_init(wdt_init); -module_exit(wdt_exit); +module_pci_driver(wdt_driver); MODULE_AUTHOR("Marc Vertes"); MODULE_DESCRIPTION("Driver for watchdog timer on VIA chipset"); |