diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-18 11:13:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-25 15:02:10 -0400 |
commit | c7b50a2a29451f9a6ec6bc7fd4c8ad836297ffc4 (patch) | |
tree | 9536ec5193b1b1f278270c9daaa391253c930299 /drivers/vme | |
parent | 5f1e7790963f03c5789070b3954f38d038ad528b (diff) |
vme: vme_ca91cx42.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>
Diffstat (limited to 'drivers/vme')
-rw-r--r-- | drivers/vme/bridges/vme_ca91cx42.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c index 1425d22cf956..64bfea314429 100644 --- a/drivers/vme/bridges/vme_ca91cx42.c +++ b/drivers/vme/bridges/vme_ca91cx42.c | |||
@@ -34,10 +34,8 @@ | |||
34 | #include "../vme_bridge.h" | 34 | #include "../vme_bridge.h" |
35 | #include "vme_ca91cx42.h" | 35 | #include "vme_ca91cx42.h" |
36 | 36 | ||
37 | static int __init ca91cx42_init(void); | ||
38 | static int ca91cx42_probe(struct pci_dev *, const struct pci_device_id *); | 37 | static int ca91cx42_probe(struct pci_dev *, const struct pci_device_id *); |
39 | static void ca91cx42_remove(struct pci_dev *); | 38 | static void ca91cx42_remove(struct pci_dev *); |
40 | static void __exit ca91cx42_exit(void); | ||
41 | 39 | ||
42 | /* Module parameters */ | 40 | /* Module parameters */ |
43 | static int geoid; | 41 | static int geoid; |
@@ -1523,11 +1521,6 @@ static void ca91cx42_free_consistent(struct device *parent, size_t size, | |||
1523 | pci_free_consistent(pdev, size, vaddr, dma); | 1521 | pci_free_consistent(pdev, size, vaddr, dma); |
1524 | } | 1522 | } |
1525 | 1523 | ||
1526 | static int __init ca91cx42_init(void) | ||
1527 | { | ||
1528 | return pci_register_driver(&ca91cx42_driver); | ||
1529 | } | ||
1530 | |||
1531 | /* | 1524 | /* |
1532 | * Configure CR/CSR space | 1525 | * Configure CR/CSR space |
1533 | * | 1526 | * |
@@ -1944,16 +1937,10 @@ static void ca91cx42_remove(struct pci_dev *pdev) | |||
1944 | kfree(ca91cx42_bridge); | 1937 | kfree(ca91cx42_bridge); |
1945 | } | 1938 | } |
1946 | 1939 | ||
1947 | static void __exit ca91cx42_exit(void) | 1940 | module_pci_driver(ca91cx42_driver); |
1948 | { | ||
1949 | pci_unregister_driver(&ca91cx42_driver); | ||
1950 | } | ||
1951 | 1941 | ||
1952 | MODULE_PARM_DESC(geoid, "Override geographical addressing"); | 1942 | MODULE_PARM_DESC(geoid, "Override geographical addressing"); |
1953 | module_param(geoid, int, 0); | 1943 | module_param(geoid, int, 0); |
1954 | 1944 | ||
1955 | MODULE_DESCRIPTION("VME driver for the Tundra Universe II VME bridge"); | 1945 | MODULE_DESCRIPTION("VME driver for the Tundra Universe II VME bridge"); |
1956 | MODULE_LICENSE("GPL"); | 1946 | MODULE_LICENSE("GPL"); |
1957 | |||
1958 | module_init(ca91cx42_init); | ||
1959 | module_exit(ca91cx42_exit); | ||