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

PCI/IOV: Simplify pci-pf-stub with module_pci_driver()

Use the module_pci_driver() macro to make the code simpler by eliminating
module_init() and module_exit() calls.

Link: https://lore.kernel.org/r/20200917071042.1909191-1-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>

authored by

Liu Shixin and committed by
Bjorn Helgaas
462bd2fd e7a7499d

+1 -13
+1 -13
drivers/pci/pci-pf-stub.c
··· 37 37 .probe = pci_pf_stub_probe, 38 38 .sriov_configure = pci_sriov_configure_simple, 39 39 }; 40 - 41 - static int __init pci_pf_stub_init(void) 42 - { 43 - return pci_register_driver(&pf_stub_driver); 44 - } 45 - 46 - static void __exit pci_pf_stub_exit(void) 47 - { 48 - pci_unregister_driver(&pf_stub_driver); 49 - } 50 - 51 - module_init(pci_pf_stub_init); 52 - module_exit(pci_pf_stub_exit); 40 + module_pci_driver(pf_stub_driver); 53 41 54 42 MODULE_LICENSE("GPL");