Skip to contentSkip to conversation

r6040: use module_pci_driver macro

PATCH Applied Devendra Naga 3 participants 3 messages Jul 8, 2012 – Jul 9, 2012

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

PATCH 1/1 r6040: use module_pci_driver macro

as the manual of module_pci_driver says that it can be used when the init and exit functions of the module does nothing but the pci_register_driver and pci_unregister_driver.

use it for rdc's r6040 driver, as the init and exit paths does as above, and also this reduces a little amount of code.

---
 drivers/net/ethernet/rdc/r6040.c |   15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
drivers/net/ethernet/rdc/r6040.c +1 -14
index 9acc026..557a265 100644
@@ -1277,17 +1277,4 @@ static struct pci_driver r6040_driver = {
 	.remove		= __devexit_p(r6040_remove_one),
 };
 
-
-static int __init r6040_init(void)
-{
-	return pci_register_driver(&r6040_driver);
-}
-
-
-static void __exit r6040_cleanup(void)
-{
-	pci_unregister_driver(&r6040_driver);
-}
-
-module_init(r6040_init);
-module_exit(r6040_cleanup);
+module_pci_driver(r6040_driver);
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Devendra Naga

as the manual of module_pci_driver says that it can be used when the init and exit functions of the module does nothing but the pci_register_driver and pci_unregister_driver.

use it for rdc's r6040 driver, as the init and exit paths does as above, and also this reduces a little amount of code.

Quoted 27 lines
---
 drivers/net/ethernet/rdc/r6040.c |   15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/rdc/r6040.c index 9acc026..557a265 100644

drivers/net/ethernet/rdc/r6040.c +1 -14
@@ -1277,17 +1277,4 @@ static struct pci_driver r6040_driver = {
 	.remove		= __devexit_p(r6040_remove_one),
 };
 
-
-static int __init r6040_init(void)
-{
-	return pci_register_driver(&r6040_driver);
-}
-
-
-static void __exit r6040_cleanup(void)
-{
-	pci_unregister_driver(&r6040_driver);
-}
-
-module_init(r6040_init);
-module_exit(r6040_cleanup);
+module_pci_driver(r6040_driver);
Signature · 1 line
Florian
maintainer Applied
#2 lore raw

From: Florian Fainelli <[email protected]>
Date: Sun, 8 Jul 2012 23:39:17 +0200

Quoted 6 lines · Devendra Naga
Quoted 5 lines

as the manual of module_pci_driver says that it can be used when the init and exit functions of the module does nothing but the pci_register_driver and pci_unregister_driver.

Quoted 7 lines
Quoted 5 lines

use it for rdc's r6040 driver, as the init and exit paths does as above, and also this reduces a little amount of code.

Applied.