Skip to contentSkip to conversation

vfio/fsl-mc: Use module_fsl_mc_driver macro to simplify the code

PATCH Applied Li Zetao 3 participants 3 messages Aug 9, 2023 – Aug 17, 2023

Subsystems (3)
lore
Share & tools
lore

Li Zetao

author
#0 lore raw

PATCH 1/1 vfio/fsl-mc: Use module_fsl_mc_driver macro to simplify the code

Use the module_fsl_mc_driver macro to simplify the code and remove redundant initialization owner in vfio_fsl_mc_driver.

---
 drivers/vfio/fsl-mc/vfio_fsl_mc.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/vfio/fsl-mc/vfio_fsl_mc.c +1 -13
index 116358a8f1cf..f65d91c01f2e 100644
@@ -601,23 +601,11 @@ static struct fsl_mc_driver vfio_fsl_mc_driver = {
 	.remove		= vfio_fsl_mc_remove,
 	.driver	= {
 		.name	= "vfio-fsl-mc",
-		.owner	= THIS_MODULE,
 	},
 	.driver_managed_dma = true,
 };
 
-static int __init vfio_fsl_mc_driver_init(void)
-{
-	return fsl_mc_driver_register(&vfio_fsl_mc_driver);
-}
-
-static void __exit vfio_fsl_mc_driver_exit(void)
-{
-	fsl_mc_driver_unregister(&vfio_fsl_mc_driver);
-}
-
-module_init(vfio_fsl_mc_driver_init);
-module_exit(vfio_fsl_mc_driver_exit);
+module_fsl_mc_driver(vfio_fsl_mc_driver);
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_DESCRIPTION("VFIO for FSL-MC devices - User Level meta-driver");
Signature · 1 line
2.34.1
#2 lore raw
In reply to Li Zetao
Quoted 7 lines · On Wed, 9 Aug 2023 21:15:36 +0800 Li Zetao <[email protected]> wrote:

Use the module_fsl_mc_driver macro to simplify the code and remove redundant initialization owner in vfio_fsl_mc_driver.

---
 drivers/vfio/fsl-mc/vfio_fsl_mc.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Applied to vfio next branch for v6.6. Thanks!

Alex

Quoted 30 lines
drivers/vfio/fsl-mc/vfio_fsl_mc.c +1 -13
index 116358a8f1cf..f65d91c01f2e 100644
@@ -601,23 +601,11 @@ static struct fsl_mc_driver vfio_fsl_mc_driver = {
 	.remove		= vfio_fsl_mc_remove,
 	.driver	= {
 		.name	= "vfio-fsl-mc",
-		.owner	= THIS_MODULE,
 	},
 	.driver_managed_dma = true,
 };
 
-static int __init vfio_fsl_mc_driver_init(void)
-{
-	return fsl_mc_driver_register(&vfio_fsl_mc_driver);
-}
-
-static void __exit vfio_fsl_mc_driver_exit(void)
-{
-	fsl_mc_driver_unregister(&vfio_fsl_mc_driver);
-}
-
-module_init(vfio_fsl_mc_driver_init);
-module_exit(vfio_fsl_mc_driver_exit);
+module_fsl_mc_driver(vfio_fsl_mc_driver);
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_DESCRIPTION("VFIO for FSL-MC devices - User Level meta-driver");