Skip to content

Commit

Permalink
Merge branch 'pci/remove-old-api'
Browse files Browse the repository at this point in the history
- In dw-xdata-pcie, pci_endpoint_test, and vmd, replace usage of deprecated
  ida_simple_*() API with ida_alloc() and ida_free() (Christophe JAILLET)

* pci/remove-old-api:
  dw-xdata: Remove usage of the deprecated ida_simple_*() API
  misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_*() API
  PCI: vmd: Remove usage of the deprecated ida_simple_*() API
  • Loading branch information
bjorn-helgaas committed Jan 15, 2024
2 parents d43e423 + 0171e06 commit eddcaef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions drivers/misc/dw-xdata-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev,

dw->pdev = pdev;

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

err_ida_remove:
ida_simple_remove(&xdata_ida, id);
ida_free(&xdata_ida, id);

return err;
}
Expand All @@ -396,7 +396,7 @@ static void dw_xdata_pcie_remove(struct pci_dev *pdev)
dw_xdata_stop(dw);
misc_deregister(&dw->misc_dev);
kfree(dw->misc_dev.name);
ida_simple_remove(&xdata_ida, id);
ida_free(&xdata_ida, id);
}

static const struct pci_device_id dw_xdata_pcie_id_table[] = {
Expand Down
6 changes: 3 additions & 3 deletions drivers/misc/pci_endpoint_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,

pci_set_drvdata(pdev, test);

id = ida_simple_get(&pci_endpoint_test_ida, 0, 0, GFP_KERNEL);
id = ida_alloc(&pci_endpoint_test_ida, GFP_KERNEL);
if (id < 0) {
err = id;
dev_err(dev, "Unable to get id\n");
Expand Down Expand Up @@ -907,7 +907,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
kfree(test->name);

err_ida_remove:
ida_simple_remove(&pci_endpoint_test_ida, id);
ida_free(&pci_endpoint_test_ida, id);

err_iounmap:
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
Expand Down Expand Up @@ -943,7 +943,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev)
misc_deregister(&test->miscdev);
kfree(misc_device->name);
kfree(test->name);
ida_simple_remove(&pci_endpoint_test_ida, id);
ida_free(&pci_endpoint_test_ida, id);
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
if (test->bar[bar])
pci_iounmap(pdev, test->bar[bar]);
Expand Down

0 comments on commit eddcaef

Please sign in to comment.