Skip to content

Commit 1075ee6

Browse files
tititiou36vinodkoul
authored andcommitted
dmaengine: idxd: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. Sothis change allows one more device. MINORMASK is ((1U << MINORBITS) - 1), so allowing MINORMASK as a maximum value makes sense. It is also consistent with other "ida_.*MINORMASK" and "ida_*MINOR()" usages. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Acked-by: Lijun Pan <[email protected]> Link: https://lore.kernel.org/r/ac991f5f42112fa782a881d391d447529cbc4a23.1702967302.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <[email protected]>
1 parent 70f008f commit 1075ee6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dma/idxd/cdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void idxd_cdev_dev_release(struct device *dev)
165165
struct idxd_wq *wq = idxd_cdev->wq;
166166

167167
cdev_ctx = &ictx[wq->idxd->data->type];
168-
ida_simple_remove(&cdev_ctx->minor_ida, idxd_cdev->minor);
168+
ida_free(&cdev_ctx->minor_ida, idxd_cdev->minor);
169169
kfree(idxd_cdev);
170170
}
171171

@@ -463,7 +463,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq)
463463
cdev = &idxd_cdev->cdev;
464464
dev = cdev_dev(idxd_cdev);
465465
cdev_ctx = &ictx[wq->idxd->data->type];
466-
minor = ida_simple_get(&cdev_ctx->minor_ida, 0, MINORMASK, GFP_KERNEL);
466+
minor = ida_alloc_max(&cdev_ctx->minor_ida, MINORMASK, GFP_KERNEL);
467467
if (minor < 0) {
468468
kfree(idxd_cdev);
469469
return minor;

0 commit comments

Comments
 (0)