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/pcwd_pci.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/pcwd_pci.c')
-rw-r--r-- | drivers/watchdog/pcwd_pci.c | 18 |
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, | |||
707 | goto err_out_disable_device; | 707 | goto err_out_disable_device; |
708 | } | 708 | } |
709 | 709 | ||
710 | spin_lock_init(&pcipcwd_private.io_lock); | ||
710 | pcipcwd_private.pdev = pdev; | 711 | pcipcwd_private.pdev = pdev; |
711 | pcipcwd_private.io_addr = pci_resource_start(pdev, 0); | 712 | pcipcwd_private.io_addr = pci_resource_start(pdev, 0); |
712 | 713 | ||
@@ -814,22 +815,7 @@ static struct pci_driver pcipcwd_driver = { | |||
814 | .remove = __devexit_p(pcipcwd_card_exit), | 815 | .remove = __devexit_p(pcipcwd_card_exit), |
815 | }; | 816 | }; |
816 | 817 | ||
817 | static int __init pcipcwd_init_module(void) | 818 | module_pci_driver(pcipcwd_driver); |
818 | { | ||
819 | spin_lock_init(&pcipcwd_private.io_lock); | ||
820 | |||
821 | return pci_register_driver(&pcipcwd_driver); | ||
822 | } | ||
823 | |||
824 | static void __exit pcipcwd_cleanup_module(void) | ||
825 | { | ||
826 | pci_unregister_driver(&pcipcwd_driver); | ||
827 | |||
828 | pr_info("Watchdog Module Unloaded\n"); | ||
829 | } | ||
830 | |||
831 | module_init(pcipcwd_init_module); | ||
832 | module_exit(pcipcwd_cleanup_module); | ||
833 | 819 | ||
834 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); | 820 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); |
835 | MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver"); | 821 | MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver"); |