summaryrefslogtreecommitdiff
path: root/drivers/watchdog/pcwd_pci.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/pcwd_pci.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/pcwd_pci.c')
-rw-r--r--drivers/watchdog/pcwd_pci.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
index c891399bed6a..ee6900da8678 100644
--- a/drivers/watchdog/pcwd_pci.c
+++ b/drivers/watchdog/pcwd_pci.c
@@ -707,6 +707,7 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
goto err_out_disable_device;
}
+ spin_lock_init(&pcipcwd_private.io_lock);
pcipcwd_private.pdev = pdev;
pcipcwd_private.io_addr = pci_resource_start(pdev, 0);
@@ -814,22 +815,7 @@ static struct pci_driver pcipcwd_driver = {
.remove = __devexit_p(pcipcwd_card_exit),
};
-static int __init pcipcwd_init_module(void)
-{
- spin_lock_init(&pcipcwd_private.io_lock);
-
- return pci_register_driver(&pcipcwd_driver);
-}
-
-static void __exit pcipcwd_cleanup_module(void)
-{
- pci_unregister_driver(&pcipcwd_driver);
-
- pr_info("Watchdog Module Unloaded\n");
-}
-
-module_init(pcipcwd_init_module);
-module_exit(pcipcwd_cleanup_module);
+module_pci_driver(pcipcwd_driver);
MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver");