Skip to content

Commit

Permalink
vfio: Replace module request with softdep
Browse files Browse the repository at this point in the history
Rather than doing a module request from within the init function, add
a soft dependency on the available IOMMU backend drivers.  This makes
the dependency visible to userspace when picking modules for the
ram disk.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information
awilliam committed Feb 9, 2017
1 parent f790eb5 commit 0ca582f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/vfio/vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2250,14 +2250,6 @@ static int __init vfio_init(void)

pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n");

/*
* Attempt to load known iommu-drivers. This gives us a working
* environment without the user needing to explicitly load iommu
* drivers.
*/
request_module_nowait("vfio_iommu_type1");
request_module_nowait("vfio_iommu_spapr_tce");

#ifdef CONFIG_VFIO_NOIOMMU
vfio_register_iommu_driver(&vfio_noiommu_ops);
#endif
Expand Down Expand Up @@ -2297,3 +2289,4 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_ALIAS_MISCDEV(VFIO_MINOR);
MODULE_ALIAS("devname:vfio/vfio");
MODULE_SOFTDEP("post: vfio_iommu_type1 vfio_iommu_spapr_tce");

0 comments on commit 0ca582f

Please sign in to comment.