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.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20230809131536.4021639-1-lizetao1@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Li Zetao 2023-08-09 21:15:36 +08:00 committed by Alex Williamson
parent d7955ce40e
commit 6c092088fa

View File

@ -601,23 +601,11 @@ static struct fsl_mc_driver vfio_fsl_mc_driver = {
.remove = vfio_fsl_mc_remove, .remove = vfio_fsl_mc_remove,
.driver = { .driver = {
.name = "vfio-fsl-mc", .name = "vfio-fsl-mc",
.owner = THIS_MODULE,
}, },
.driver_managed_dma = true, .driver_managed_dma = true,
}; };
static int __init vfio_fsl_mc_driver_init(void) module_fsl_mc_driver(vfio_fsl_mc_driver);
{
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_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("VFIO for FSL-MC devices - User Level meta-driver"); MODULE_DESCRIPTION("VFIO for FSL-MC devices - User Level meta-driver");