summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-07-15 21:44:13 +0300
committerVinod Koul <vkoul@kernel.org>2021-07-21 07:39:16 +0300
commitc05257b5600bb35a580ecdb25695efff26326d59 (patch)
tree2cdcde072fffbcffeb026349c587366428d82337 /drivers/dma/idxd
parent745e92a6d816277fcbd231bda5ad2d882b22fe52 (diff)
downloadlinux-c05257b5600bb35a580ecdb25695efff26326d59.tar.xz
dmanegine: idxd: open code the dsa_drv registration
Don't need a wrapper to register the driver. Just do it directly. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637465319.744545.16325178432532362906.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd')
-rw-r--r--drivers/dma/idxd/idxd.h2
-rw-r--r--drivers/dma/idxd/init.c10
-rw-r--r--drivers/dma/idxd/sysfs.c13
3 files changed, 8 insertions, 17 deletions
diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index 1c8abba13470..7fc26b7727c0 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -56,6 +56,8 @@ struct idxd_device_driver {
struct device_driver drv;
};
+extern struct idxd_device_driver dsa_drv;
+
struct idxd_irq_entry {
struct idxd_device *idxd;
int id;
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index c22225b14c5d..5b628e6c04bf 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -840,9 +840,9 @@ static int __init idxd_init_module(void)
if (err < 0)
return err;
- err = idxd_register_driver();
+ err = idxd_driver_register(&dsa_drv);
if (err < 0)
- goto err_idxd_driver_register;
+ goto err_dsa_driver_register;
err = idxd_cdev_register();
if (err)
@@ -857,8 +857,8 @@ static int __init idxd_init_module(void)
err_pci_register:
idxd_cdev_remove();
err_cdev_register:
- idxd_unregister_driver();
-err_idxd_driver_register:
+ idxd_driver_unregister(&dsa_drv);
+err_dsa_driver_register:
idxd_unregister_bus_type();
return err;
}
@@ -866,7 +866,7 @@ module_init(idxd_init_module);
static void __exit idxd_exit_module(void)
{
- idxd_unregister_driver();
+ idxd_driver_unregister(&dsa_drv);
pci_unregister_driver(&idxd_pci_driver);
idxd_cdev_remove();
idxd_unregister_bus_type();
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index abea8aca6799..9f2d06c2aa98 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -79,23 +79,12 @@ static void idxd_dsa_drv_remove(struct idxd_dev *idxd_dev)
}
}
-static struct idxd_device_driver dsa_drv = {
+struct idxd_device_driver dsa_drv = {
.name = "dsa",
.probe = idxd_dsa_drv_probe,
.remove = idxd_dsa_drv_remove,
};
-/* IDXD generic driver setup */
-int idxd_register_driver(void)
-{
- return idxd_driver_register(&dsa_drv);
-}
-
-void idxd_unregister_driver(void)
-{
- idxd_driver_unregister(&dsa_drv);
-}
-
/* IDXD engine attributes */
static ssize_t engine_group_id_show(struct device *dev,
struct device_attribute *attr, char *buf)