Skip to contentSkip to conversation

net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro

PATCH Applied Yang Yingliang 3 participants 3 messages Aug 10, 2023 – Aug 11, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro

The driver init/exit() function don't do anything special, it can use the module_pci_driver() macro to eliminate boilerplate code.

---
 drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
drivers/net/ethernet/8390/ne2k-pci.c +1 -15
index 2c6bd36d2f31..65f56a98c0a0 100644
@@ -731,18 +731,4 @@ static struct pci_driver ne2k_driver = {
 	.id_table	= ne2k_pci_tbl,
 	.driver.pm	= &ne2k_pci_pm_ops,
 };
-
-
-static int __init ne2k_pci_init(void)
-{
-	return pci_register_driver(&ne2k_driver);
-}
-
-
-static void __exit ne2k_pci_cleanup(void)
-{
-	pci_unregister_driver(&ne2k_driver);
-}
-
-module_init(ne2k_pci_init);
-module_exit(ne2k_pci_cleanup);
+module_pci_driver(ne2k_driver);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 35 lines · Yang Yingliang

The driver init/exit() function don't do anything special, it can use the module_pci_driver() macro to eliminate boilerplate code.

---
 drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
drivers/net/ethernet/8390/ne2k-pci.c +1 -16
index 2c6bd36d2f31..65f56a98c0a0 100644
@@ -731,18 +731,4 @@ static struct pci_driver ne2k_driver = {
        .id_table       = ne2k_pci_tbl,
        .driver.pm      = &ne2k_pci_pm_ops,
 };
-
-
-static int __init ne2k_pci_init(void)
-{
-       return pci_register_driver(&ne2k_driver);
-}
-
-
-static void __exit ne2k_pci_cleanup(void)
-{
-       pci_unregister_driver(&ne2k_driver);
-}
-
-module_init(ne2k_pci_init);
-module_exit(ne2k_pci_cleanup);
+module_pci_driver(ne2k_driver);
--
Quoted 3 lines

2.25.1

LGTM.

#2 lore raw
In reply to Yang Yingliang
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 10 Aug 2023 09:46:33 +0800 you wrote:

The driver init/exit() function don't do anything special, it can use the module_pci_driver() macro to eliminate boilerplate code.

---
 drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

Here is the summary with links:
- [net-next] net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro

    https://git.kernel.org/netdev/net-next/c/5604ac35cb6e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html