Skip to contentSkip to conversation

net: arcnet: com20020-pci: use module_pci_driver

PATCH Applied Ethan Nelson-Moore 3 participants 4 messages Feb 5 – Feb 10

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

PATCH 1/1 net: arcnet: com20020-pci: use module_pci_driver

The only thing this driver's init/exit functions do is call pci_register/unregister_driver, and in the case of the init function, print an unnecessary message. Replace them with module_pci_driver to simplify the code.

---
 drivers/net/arcnet/com20020-pci.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
drivers/net/arcnet/com20020-pci.c +1 -14
index 0472bcdff130..19e411b2e3a7 100644
@@ -618,17 +618,4 @@ static struct pci_driver com20020pci_driver = {
 	.remove		= com20020pci_remove,
 };
 
-static int __init com20020pci_init(void)
-{
-	if (BUGLVL(D_NORMAL))
-		pr_info("%s\n", "COM20020 PCI support");
-	return pci_register_driver(&com20020pci_driver);
-}
-
-static void __exit com20020pci_cleanup(void)
-{
-	pci_unregister_driver(&com20020pci_driver);
-}
-
-module_init(com20020pci_init)
-module_exit(com20020pci_cleanup)
+module_pci_driver(com20020pci_driver);
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ethan Nelson-Moore

The only thing this driver's init/exit functions do is call pci_register/unregister_driver, and in the case of the init function, print an unnecessary message. Replace them with module_pci_driver to simplify the code.

I'm not sure that I see the value of cleanups to this driver. Which hasn't seen much activity for a while now.

But I agree the change is correct.

...

#2 lore raw

Hi, Simon,

Quoted 2 lines · Simon Horman

I'm not sure that I see the value of cleanups to this driver. Which hasn't seen much activity for a while now.

That probably indicates that it has no major issues, not that it isn't being used. ARCnet cards are still actively sold by Contemporary Controls and SOHARD; ARCnet is used in industrial environments where its timing determinism is important.

Ethan

#3 lore raw
In reply to Ethan Nelson-Moore
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

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

Quoted 8 lines · On Wed, 4 Feb 2026 23:06:31 -0800 you wrote:

The only thing this driver's init/exit functions do is call pci_register/unregister_driver, and in the case of the init function, print an unnecessary message. Replace them with module_pci_driver to simplify the code.

[...]

Here is the summary with links:
- [net-next] net: arcnet: com20020-pci: use module_pci_driver

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

You are awesome, thank you!

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