Commit d7ad915d authored by Tom Zanussi's avatar Tom Zanussi Committed by Herbert Xu

dmaengine: idxd: Rename drv_enable/disable_wq to idxd_drv_enable/disable_wq, and export

Rename drv_enable_wq and drv_disable_wq to idxd_drv_enable_wq and
idxd_drv_disable_wq respectively, so that they're no longer too
generic to be exported.  This also matches existing naming within the
idxd driver.

And to allow idxd sub-drivers to enable and disable wqs, export them.
Signed-off-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 15a61101
...@@ -550,7 +550,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev) ...@@ -550,7 +550,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
} }
wq->type = IDXD_WQT_USER; wq->type = IDXD_WQT_USER;
rc = drv_enable_wq(wq); rc = idxd_drv_enable_wq(wq);
if (rc < 0) if (rc < 0)
goto err; goto err;
...@@ -565,7 +565,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev) ...@@ -565,7 +565,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
return 0; return 0;
err_cdev: err_cdev:
drv_disable_wq(wq); idxd_drv_disable_wq(wq);
err: err:
destroy_workqueue(wq->wq); destroy_workqueue(wq->wq);
wq->type = IDXD_WQT_NONE; wq->type = IDXD_WQT_NONE;
...@@ -580,7 +580,7 @@ static void idxd_user_drv_remove(struct idxd_dev *idxd_dev) ...@@ -580,7 +580,7 @@ static void idxd_user_drv_remove(struct idxd_dev *idxd_dev)
mutex_lock(&wq->wq_lock); mutex_lock(&wq->wq_lock);
idxd_wq_del_cdev(wq); idxd_wq_del_cdev(wq);
drv_disable_wq(wq); idxd_drv_disable_wq(wq);
wq->type = IDXD_WQT_NONE; wq->type = IDXD_WQT_NONE;
destroy_workqueue(wq->wq); destroy_workqueue(wq->wq);
wq->wq = NULL; wq->wq = NULL;
......
...@@ -1350,7 +1350,7 @@ int idxd_wq_request_irq(struct idxd_wq *wq) ...@@ -1350,7 +1350,7 @@ int idxd_wq_request_irq(struct idxd_wq *wq)
return rc; return rc;
} }
int drv_enable_wq(struct idxd_wq *wq) int idxd_drv_enable_wq(struct idxd_wq *wq)
{ {
struct idxd_device *idxd = wq->idxd; struct idxd_device *idxd = wq->idxd;
struct device *dev = &idxd->pdev->dev; struct device *dev = &idxd->pdev->dev;
...@@ -1482,8 +1482,9 @@ int drv_enable_wq(struct idxd_wq *wq) ...@@ -1482,8 +1482,9 @@ int drv_enable_wq(struct idxd_wq *wq)
err: err:
return rc; return rc;
} }
EXPORT_SYMBOL_NS_GPL(idxd_drv_enable_wq, IDXD);
void drv_disable_wq(struct idxd_wq *wq) void idxd_drv_disable_wq(struct idxd_wq *wq)
{ {
struct idxd_device *idxd = wq->idxd; struct idxd_device *idxd = wq->idxd;
struct device *dev = &idxd->pdev->dev; struct device *dev = &idxd->pdev->dev;
...@@ -1503,6 +1504,7 @@ void drv_disable_wq(struct idxd_wq *wq) ...@@ -1503,6 +1504,7 @@ void drv_disable_wq(struct idxd_wq *wq)
wq->type = IDXD_WQT_NONE; wq->type = IDXD_WQT_NONE;
wq->client_count = 0; wq->client_count = 0;
} }
EXPORT_SYMBOL_NS_GPL(idxd_drv_disable_wq, IDXD);
int idxd_device_drv_probe(struct idxd_dev *idxd_dev) int idxd_device_drv_probe(struct idxd_dev *idxd_dev)
{ {
......
...@@ -314,7 +314,7 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev) ...@@ -314,7 +314,7 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev)
wq->type = IDXD_WQT_KERNEL; wq->type = IDXD_WQT_KERNEL;
rc = drv_enable_wq(wq); rc = idxd_drv_enable_wq(wq);
if (rc < 0) { if (rc < 0) {
dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc); dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc);
rc = -ENXIO; rc = -ENXIO;
...@@ -333,7 +333,7 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev) ...@@ -333,7 +333,7 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev)
return 0; return 0;
err_dma: err_dma:
drv_disable_wq(wq); idxd_drv_disable_wq(wq);
err: err:
wq->type = IDXD_WQT_NONE; wq->type = IDXD_WQT_NONE;
mutex_unlock(&wq->wq_lock); mutex_unlock(&wq->wq_lock);
...@@ -347,7 +347,7 @@ static void idxd_dmaengine_drv_remove(struct idxd_dev *idxd_dev) ...@@ -347,7 +347,7 @@ static void idxd_dmaengine_drv_remove(struct idxd_dev *idxd_dev)
mutex_lock(&wq->wq_lock); mutex_lock(&wq->wq_lock);
__idxd_wq_quiesce(wq); __idxd_wq_quiesce(wq);
idxd_unregister_dma_channel(wq); idxd_unregister_dma_channel(wq);
drv_disable_wq(wq); idxd_drv_disable_wq(wq);
mutex_unlock(&wq->wq_lock); mutex_unlock(&wq->wq_lock);
} }
......
...@@ -685,8 +685,8 @@ void idxd_unmask_error_interrupts(struct idxd_device *idxd); ...@@ -685,8 +685,8 @@ void idxd_unmask_error_interrupts(struct idxd_device *idxd);
/* device control */ /* device control */
int idxd_device_drv_probe(struct idxd_dev *idxd_dev); int idxd_device_drv_probe(struct idxd_dev *idxd_dev);
void idxd_device_drv_remove(struct idxd_dev *idxd_dev); void idxd_device_drv_remove(struct idxd_dev *idxd_dev);
int drv_enable_wq(struct idxd_wq *wq); int idxd_drv_enable_wq(struct idxd_wq *wq);
void drv_disable_wq(struct idxd_wq *wq); void idxd_drv_disable_wq(struct idxd_wq *wq);
int idxd_device_init_reset(struct idxd_device *idxd); int idxd_device_init_reset(struct idxd_device *idxd);
int idxd_device_enable(struct idxd_device *idxd); int idxd_device_enable(struct idxd_device *idxd);
int idxd_device_disable(struct idxd_device *idxd); int idxd_device_disable(struct idxd_device *idxd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment