Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
c7b50a2a 5f1e7790

+1 -14
+1 -14
drivers/vme/bridges/vme_ca91cx42.c
··· 34 34 #include "../vme_bridge.h" 35 35 #include "vme_ca91cx42.h" 36 36 37 - static int __init ca91cx42_init(void); 38 37 static int ca91cx42_probe(struct pci_dev *, const struct pci_device_id *); 39 38 static void ca91cx42_remove(struct pci_dev *); 40 - static void __exit ca91cx42_exit(void); 41 39 42 40 /* Module parameters */ 43 41 static int geoid; ··· 1521 1523 pci_free_consistent(pdev, size, vaddr, dma); 1522 1524 } 1523 1525 1524 - static int __init ca91cx42_init(void) 1525 - { 1526 - return pci_register_driver(&ca91cx42_driver); 1527 - } 1528 - 1529 1526 /* 1530 1527 * Configure CR/CSR space 1531 1528 * ··· 1937 1944 kfree(ca91cx42_bridge); 1938 1945 } 1939 1946 1940 - static void __exit ca91cx42_exit(void) 1941 - { 1942 - pci_unregister_driver(&ca91cx42_driver); 1943 - } 1947 + module_pci_driver(ca91cx42_driver); 1944 1948 1945 1949 MODULE_PARM_DESC(geoid, "Override geographical addressing"); 1946 1950 module_param(geoid, int, 0); 1947 1951 1948 1952 MODULE_DESCRIPTION("VME driver for the Tundra Universe II VME bridge"); 1949 1953 MODULE_LICENSE("GPL"); 1950 - 1951 - module_init(ca91cx42_init); 1952 - module_exit(ca91cx42_exit);