diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2012-05-04 08:43:25 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-05-23 10:23:53 -0400 |
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 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, | |||
202 | goto err_out_release; | 202 | goto err_out_release; |
203 | } | 203 | } |
204 | 204 | ||
205 | if (timeout < 1 || timeout > WDT_TIMEOUT_MAX) | ||
206 | timeout = WDT_TIMEOUT; | ||
207 | |||
205 | wdt_dev.timeout = timeout; | 208 | wdt_dev.timeout = timeout; |
206 | watchdog_set_nowayout(&wdt_dev, nowayout); | 209 | watchdog_set_nowayout(&wdt_dev, nowayout); |
207 | if (readl(wdt_mem) & VIA_WDT_FIRED) | 210 | if (readl(wdt_mem) & VIA_WDT_FIRED) |
@@ -250,20 +253,7 @@ static struct pci_driver wdt_driver = { | |||
250 | .remove = __devexit_p(wdt_remove), | 253 | .remove = __devexit_p(wdt_remove), |
251 | }; | 254 | }; |
252 | 255 | ||
253 | static int __init wdt_init(void) | 256 | module_pci_driver(wdt_driver); |
254 | { | ||
255 | if (timeout < 1 || timeout > WDT_TIMEOUT_MAX) | ||
256 | timeout = WDT_TIMEOUT; | ||
257 | return pci_register_driver(&wdt_driver); | ||
258 | } | ||
259 | |||
260 | static void __exit wdt_exit(void) | ||
261 | { | ||
262 | pci_unregister_driver(&wdt_driver); | ||
263 | } | ||
264 | |||
265 | module_init(wdt_init); | ||
266 | module_exit(wdt_exit); | ||
267 | 257 | ||
268 | MODULE_AUTHOR("Marc Vertes"); | 258 | MODULE_AUTHOR("Marc Vertes"); |
269 | MODULE_DESCRIPTION("Driver for watchdog timer on VIA chipset"); | 259 | MODULE_DESCRIPTION("Driver for watchdog timer on VIA chipset"); |