Skip to content

Commit

Permalink
dmaengine: idxd: make idxd_wq_enable() return 0 if wq is already enabled
Browse files Browse the repository at this point in the history
When calling idxd_wq_enable() and wq is already enabled, code should return 0
and indicate function is successful instead of return error code and fail.
This should also put idxd_wq_enable() in sync with idxd_wq_disable() where
it returns 0 if wq is already disabled.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/165090980906.1378449.1939401700832432886.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Dave Jiang authored and Vinod Koul committed May 19, 2022
1 parent 8292a15 commit d1a2859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/idxd/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int idxd_wq_enable(struct idxd_wq *wq)

if (wq->state == IDXD_WQ_ENABLED) {
dev_dbg(dev, "WQ %d already enabled\n", wq->id);
return -ENXIO;
return 0;
}

idxd_cmd_exec(idxd, IDXD_CMD_ENABLE_WQ, wq->id, &status);
Expand Down

0 comments on commit d1a2859

Please sign in to comment.