From: Alex Williamson Date: Wed, 8 Feb 2017 20:13:25 +0000 (-0700) Subject: vfio/mdev: Use a module softdep for vfio_mdev X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f790eb57e6ec8d77489755cc25a51c4409e2f590;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vfio/mdev: Use a module softdep for vfio_mdev Use an explicit module softdep rather than a request module call such that the dependency is exposed to userspace. This allows us to more easily support modules loaded at initrd time. Reviewed by: Kirti Wankhede Signed-off-by: Alex Williamson --- diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 36d75c367d22..126991046eb7 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -422,18 +422,7 @@ int mdev_device_remove(struct device *dev, bool force_remove) static int __init mdev_init(void) { - int ret; - - ret = mdev_bus_register(); - - /* - * Attempt to load known vfio_mdev. This gives us a working environment - * without the user needing to explicitly load vfio_mdev driver. - */ - if (!ret) - request_module_nowait("vfio_mdev"); - - return ret; + return mdev_bus_register(); } static void __exit mdev_exit(void) @@ -451,3 +440,4 @@ MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_SOFTDEP("post: vfio_mdev");