PCI/IOV: use module_pci_driver to simplify the code
PATCH 1/1 PCI/IOV: 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.
--- drivers/pci/pci-pf-stub.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/pci/pci-pf-stub.c +1 -13
@@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = { .probe = pci_pf_stub_probe, .sriov_configure = pci_sriov_configure_simple, }; - -static int __init pci_pf_stub_init (void ) -{ -return pci_register_driver (&pf_stub_driver); -} - -static void __exit pci_pf_stub_exit(void) -{ -pci_unregister_driver (&pf_stub_driver); -} - -module_init (pci_pf_stub_init); -module_exit (pci_pf_stub_exit); +module_pci_driver (pf_stub_driver);MODULE_LICENSE ("GPL" );
Signature · 1 line
2.25.1
Bjorn Helgaas
Applied[+cc Alexander]
Quoted 4 lines · Liu Shixin
Use the
module_pci_driver()macro to make the code simpler by eliminatingmodule_initandmodule_exitcalls.Signed-off-by Liu Shixin <[email protected]>
Applied to pci/misc for v5.10, thanks!
Quoted 31 lines
--- drivers/pci/pci-pf-stub.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)drivers/pci/pci-pf-stub.c +1
-13@@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = { .probe = pci_pf_stub_probe, .sriov_configure = pci_sriov_configure_simple, }; - -static int __init pci_pf_stub_init (void ) -{ -return pci_register_driver (&pf_stub_driver); -} - -static void __exit pci_pf_stub_exit(void) -{ -pci_unregister_driver (&pf_stub_driver); -} - -module_init (pci_pf_stub_init); -module_exit (pci_pf_stub_exit); +module_pci_driver (pf_stub_driver);MODULE_LICENSE ("GPL" );Signature · 1 line
2.25.1
Alexander Duyck
Acked-byQuoted 10 lines · Bjorn Helgaas
[+cc Alexander]
Quoted 4 lines · Liu Shixin
Use the
module_pci_driver()macro to make the code simpler by eliminatingmodule_initandmodule_exitcalls.Signed-off-by Liu Shixin <[email protected]>Applied to pci/misc for v5.10, thanks!
The code below seems pretty straight forward.
Quoted 31 lines
Quoted 31 lines
--- drivers/pci/pci-pf-stub.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)drivers/pci/pci-pf-stub.c +1
-14@@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = { .probe = pci_pf_stub_probe, .sriov_configure = pci_sriov_configure_simple, }; - -static int __init pci_pf_stub_init (void ) -{ -return pci_register_driver (&pf_stub_driver); -} - -static void __exit pci_pf_stub_exit(void) -{ -pci_unregister_driver (&pf_stub_driver); -} - -module_init (pci_pf_stub_init); -module_exit (pci_pf_stub_exit); +module_pci_driver (pf_stub_driver);MODULE_LICENSE ("GPL" ); --2.25.1
Quoted 8 lines · Alexander Duyck
Quoted 7 lines · Bjorn Helgaas
[+cc Alexander]
Quoted 3 lines · Liu Shixin
Use the
module_pci_driver()macro to make the code simpler by eliminatingmodule_initandmodule_exitcalls.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Liu Shixin <[email protected]>Applied to pci/misc for v5.10, thanks!
The code below seems pretty straight forward.
Acked-by Alexander Duyck <[email protected]>
Thanks a lot for taking a look, Alexander, I added your ack.