summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/idxd/sysfs.c')
-rw-r--r--drivers/dma/idxd/sysfs.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index f82416eec926..221a61e3bb9c 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -52,44 +52,8 @@ struct bus_type dsa_bus_type = {
static int idxd_dsa_drv_probe(struct idxd_dev *idxd_dev)
{
- struct device *dev = &idxd_dev->conf_dev;
- unsigned long flags;
- int rc;
-
- if (is_idxd_dev(idxd_dev)) {
- struct idxd_device *idxd = idxd_dev_to_idxd(idxd_dev);
-
- if (idxd->state != IDXD_DEV_DISABLED)
- return -ENXIO;
-
- /* Device configuration */
- spin_lock_irqsave(&idxd->dev_lock, flags);
- if (test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
- rc = idxd_device_config(idxd);
- spin_unlock_irqrestore(&idxd->dev_lock, flags);
- if (rc < 0) {
- dev_dbg(dev, "Device config failed: %d\n", rc);
- return rc;
- }
-
- /* Start device */
- rc = idxd_device_enable(idxd);
- if (rc < 0) {
- dev_warn(dev, "Device enable failed: %d\n", rc);
- return rc;
- }
-
- /* Setup DMA device without channels */
- rc = idxd_register_dma_device(idxd);
- if (rc < 0) {
- dev_dbg(dev, "Failed to register dmaengine device\n");
- idxd_device_disable(idxd);
- return rc;
- }
-
- dev_info(dev, "Device %s enabled\n", dev_name(dev));
- return 0;
- }
+ if (is_idxd_dev(idxd_dev))
+ return idxd_device_drv_probe(idxd_dev);
if (is_idxd_wq_dev(idxd_dev)) {
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);