summaryrefslogtreecommitdiff
path: root/drivers/watchdog/via_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2012-05-04 16:43:25 +0400
committerWim Van Sebroeck <wim@iguana.be>2012-05-23 18:23:53 +0400
commit5ce9c371c788638890980b27f0cd8af7071b3a50 (patch)
tree948f891f9211d61631199bdefb2d8adb44f951f4 /drivers/watchdog/via_wdt.c
parent8f90a3ae8f67a6c521e2d8fcb488262833f2a4cd (diff)
downloadlinux-5ce9c371c788638890980b27f0cd8af7071b3a50.tar.xz
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.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
index 465e08273c97..5603e31afdab 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");