diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-18 11:12:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-25 15:02:11 -0400 |
commit | 01c071439730013cc110dd321852b44432cf496c (patch) | |
tree | 5ab757bc707b2b509dba632cf7c64845670c13d9 | |
parent | c7b50a2a29451f9a6ec6bc7fd4c8ad836297ffc4 (diff) |
vme: vme_tsi148.c: use module_pci_driver to simplify the code
Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/vme/bridges/vme_tsi148.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c index 5fbd08ffb9c2..9c1aa4dc39c9 100644 --- a/drivers/vme/bridges/vme_tsi148.c +++ b/drivers/vme/bridges/vme_tsi148.c | |||
@@ -35,10 +35,8 @@ | |||
35 | #include "../vme_bridge.h" | 35 | #include "../vme_bridge.h" |
36 | #include "vme_tsi148.h" | 36 | #include "vme_tsi148.h" |
37 | 37 | ||
38 | static int __init tsi148_init(void); | ||
39 | static int tsi148_probe(struct pci_dev *, const struct pci_device_id *); | 38 | static int tsi148_probe(struct pci_dev *, const struct pci_device_id *); |
40 | static void tsi148_remove(struct pci_dev *); | 39 | static void tsi148_remove(struct pci_dev *); |
41 | static void __exit tsi148_exit(void); | ||
42 | 40 | ||
43 | 41 | ||
44 | /* Module parameter */ | 42 | /* Module parameter */ |
@@ -2244,11 +2242,6 @@ static void tsi148_free_consistent(struct device *parent, size_t size, | |||
2244 | pci_free_consistent(pdev, size, vaddr, dma); | 2242 | pci_free_consistent(pdev, size, vaddr, dma); |
2245 | } | 2243 | } |
2246 | 2244 | ||
2247 | static int __init tsi148_init(void) | ||
2248 | { | ||
2249 | return pci_register_driver(&tsi148_driver); | ||
2250 | } | ||
2251 | |||
2252 | /* | 2245 | /* |
2253 | * Configure CR/CSR space | 2246 | * Configure CR/CSR space |
2254 | * | 2247 | * |
@@ -2754,10 +2747,7 @@ static void tsi148_remove(struct pci_dev *pdev) | |||
2754 | kfree(tsi148_bridge); | 2747 | kfree(tsi148_bridge); |
2755 | } | 2748 | } |
2756 | 2749 | ||
2757 | static void __exit tsi148_exit(void) | 2750 | module_pci_driver(tsi148_driver); |
2758 | { | ||
2759 | pci_unregister_driver(&tsi148_driver); | ||
2760 | } | ||
2761 | 2751 | ||
2762 | MODULE_PARM_DESC(err_chk, "Check for VME errors on reads and writes"); | 2752 | MODULE_PARM_DESC(err_chk, "Check for VME errors on reads and writes"); |
2763 | module_param(err_chk, bool, 0); | 2753 | module_param(err_chk, bool, 0); |
@@ -2767,6 +2757,3 @@ module_param(geoid, int, 0); | |||
2767 | 2757 | ||
2768 | MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge"); | 2758 | MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge"); |
2769 | MODULE_LICENSE("GPL"); | 2759 | MODULE_LICENSE("GPL"); |
2770 | |||
2771 | module_init(tsi148_init); | ||
2772 | module_exit(tsi148_exit); | ||