Skip to content

Commit 0171e06

Browse files
tititiou36kwilczynski
authored andcommitted
dw-xdata: Remove usage of the deprecated ida_simple_*() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove() functions. This is also less verbose. Link: https://lore.kernel.org/linux-pci/cc01721cec2d416d7bdf47086943b17ef44b7286.1702966181.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 130f335 commit 0171e06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/misc/dw-xdata-pcie.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev,
333333

334334
dw->pdev = pdev;
335335

336-
id = ida_simple_get(&xdata_ida, 0, 0, GFP_KERNEL);
336+
id = ida_alloc(&xdata_ida, GFP_KERNEL);
337337
if (id < 0) {
338338
dev_err(dev, "xData: unable to get id\n");
339339
return id;
@@ -377,7 +377,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev,
377377
kfree(dw->misc_dev.name);
378378

379379
err_ida_remove:
380-
ida_simple_remove(&xdata_ida, id);
380+
ida_free(&xdata_ida, id);
381381

382382
return err;
383383
}
@@ -396,7 +396,7 @@ static void dw_xdata_pcie_remove(struct pci_dev *pdev)
396396
dw_xdata_stop(dw);
397397
misc_deregister(&dw->misc_dev);
398398
kfree(dw->misc_dev.name);
399-
ida_simple_remove(&xdata_ida, id);
399+
ida_free(&xdata_ida, id);
400400
}
401401

402402
static const struct pci_device_id dw_xdata_pcie_id_table[] = {

0 commit comments

Comments
 (0)