Skip to contentSkip to conversation

mmc: cavium: Use module_pci_driver to simplify the code

PATCH Applied Wei Yongjun 3 participants 3 messages Apr 25, 2017

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

PATCH 1/1 mmc: cavium: Use module_pci_driver to simplify the code

From: Wei Yongjun <[email protected]>

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

---
 drivers/mmc/host/cavium-thunderx.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-thunderx.c +1 -12
index 65244e8..fe3d772 100644
@@ -179,18 +179,7 @@ static struct pci_driver thunder_mmc_driver = {
 	.remove = thunder_mmc_remove,
 };
 
-static int __init thunder_mmc_init_module(void)
-{
-	return pci_register_driver(&thunder_mmc_driver);
-}
-
-static void __exit thunder_mmc_exit_module(void)
-{
-	pci_unregister_driver(&thunder_mmc_driver);
-}
-
-module_init(thunder_mmc_init_module);
-module_exit(thunder_mmc_exit_module);
+module_pci_driver(thunder_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc.");
 MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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

---
 drivers/mmc/host/cavium-thunderx.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-thunderx.c +0 -6
index 65244e8..fe3d772 100644
@@ -179,18 +179,7 @@ static struct pci_driver thunder_mmc_driver = {
 	.remove = thunder_mmc_remove,
 };
 
-static int __init thunder_mmc_init_module(void)
-{
-	return pci_register_driver(&thunder_mmc_driver);
-}
-
-static void __exit thunder_mmc_exit_module(void)

drivers/mmc/host/cavium-thunderx.c static struct pci_driver thunder_mmc_driver = { · line 185

Quoted 10 lines
drivers/mmc/host/cavium-thunderx.c +1 -6
-{
-	pci_unregister_driver(&thunder_mmc_driver);
-}
-
-module_init(thunder_mmc_init_module);
-module_exit(thunder_mmc_exit_module);
+module_pci_driver(thunder_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc.");
 MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
Applied
#2 lore raw
In reply to Wei Yongjun
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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

Thanks, applied for next!

Kind regards
Uffe

Quoted 31 lines
---
 drivers/mmc/host/cavium-thunderx.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-thunderx.c +1 -12
index 65244e8..fe3d772 100644
@@ -179,18 +179,7 @@ static struct pci_driver thunder_mmc_driver = {
        .remove = thunder_mmc_remove,
 };
 
-static int __init thunder_mmc_init_module(void)
-{
-       return pci_register_driver(&thunder_mmc_driver);
-}
-
-static void __exit thunder_mmc_exit_module(void)
-{
-       pci_unregister_driver(&thunder_mmc_driver);
-}
-
-module_init(thunder_mmc_init_module);
-module_exit(thunder_mmc_exit_module);
+module_pci_driver(thunder_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc.");
 MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");