summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/init.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-07-15 21:44:41 +0300
committerVinod Koul <vkoul@kernel.org>2021-07-21 07:39:16 +0300
commitd9e5481fca74f870cf2fc2f90a0e77e85c0b5b86 (patch)
treeade36205b03f01058794b58b99db8d645e63520a /drivers/dma/idxd/init.c
parent448c3de8ac8353fc4447738ae3c56c4eb6c2131d (diff)
downloadlinux-d9e5481fca74f870cf2fc2f90a0e77e85c0b5b86.tar.xz
dmaengine: dsa: move dsa_bus_type out of idxd driver to standalone
In preparation for dsa_drv compat support to be built-in, move the bus code to its own compilation unit. A follow-on patch adds the compat implementation. Recall that the compat implementation allows for the deprecated / omnibus dsa_drv binding scheme rather than the idiomatic organization of a full fledged bus driver per driver type. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637468142.744545.2811632736881720857.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/init.c')
-rw-r--r--drivers/dma/idxd/init.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 33a80f700ff8..9b797fcdfd7b 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -26,6 +26,7 @@
MODULE_VERSION(IDXD_DRIVER_VERSION);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Intel Corporation");
+MODULE_IMPORT_NS(IDXD);
static bool sva = true;
module_param(sva, bool, 0644);
@@ -836,10 +837,6 @@ static int __init idxd_init_module(void)
perfmon_init();
- err = idxd_register_bus_type();
- if (err < 0)
- return err;
-
err = idxd_driver_register(&idxd_drv);
if (err < 0)
goto err_idxd_driver_register;
@@ -877,7 +874,6 @@ err_idxd_user_driver_register:
err_idxd_dmaengine_driver_register:
idxd_driver_unregister(&idxd_drv);
err_idxd_driver_register:
- idxd_unregister_bus_type();
return err;
}
module_init(idxd_init_module);
@@ -890,30 +886,6 @@ static void __exit idxd_exit_module(void)
idxd_driver_unregister(&dsa_drv);
pci_unregister_driver(&idxd_pci_driver);
idxd_cdev_remove();
- idxd_unregister_bus_type();
perfmon_exit();
}
module_exit(idxd_exit_module);
-
-int __idxd_driver_register(struct idxd_device_driver *idxd_drv, struct module *owner,
- const char *mod_name)
-{
- struct device_driver *drv = &idxd_drv->drv;
-
- if (!idxd_drv->type) {
- pr_debug("driver type not set (%ps)\n", __builtin_return_address(0));
- return -EINVAL;
- }
-
- drv->name = idxd_drv->name;
- drv->bus = &dsa_bus_type;
- drv->owner = owner;
- drv->mod_name = mod_name;
-
- return driver_register(drv);
-}
-
-void idxd_driver_unregister(struct idxd_device_driver *idxd_drv)
-{
- driver_unregister(&idxd_drv->drv);
-}