Merge branch 'pci/remove-old-api'

- 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
This commit is contained in:
Bjorn Helgaas 2024-01-15 12:10:41 -06:00
commit eddcaefa5f
2 changed files with 6 additions and 6 deletions

View File

@ -333,7 +333,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev,
dw->pdev = pdev; dw->pdev = pdev;
id = ida_simple_get(&xdata_ida, 0, 0, GFP_KERNEL); id = ida_alloc(&xdata_ida, GFP_KERNEL);
if (id < 0) { if (id < 0) {
dev_err(dev, "xData: unable to get id\n"); dev_err(dev, "xData: unable to get id\n");
return id; return id;
@ -377,7 +377,7 @@ err_kfree_name:
kfree(dw->misc_dev.name); kfree(dw->misc_dev.name);
err_ida_remove: err_ida_remove:
ida_simple_remove(&xdata_ida, id); ida_free(&xdata_ida, id);
return err; return err;
} }
@ -396,7 +396,7 @@ static void dw_xdata_pcie_remove(struct pci_dev *pdev)
dw_xdata_stop(dw); dw_xdata_stop(dw);
misc_deregister(&dw->misc_dev); misc_deregister(&dw->misc_dev);
kfree(dw->misc_dev.name); 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[] = { static const struct pci_device_id dw_xdata_pcie_id_table[] = {

View File

@ -860,7 +860,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, test); 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) { if (id < 0) {
err = id; err = id;
dev_err(dev, "Unable to get id\n"); dev_err(dev, "Unable to get id\n");
@ -907,7 +907,7 @@ err_kfree_test_name:
kfree(test->name); kfree(test->name);
err_ida_remove: err_ida_remove:
ida_simple_remove(&pci_endpoint_test_ida, id); ida_free(&pci_endpoint_test_ida, id);
err_iounmap: err_iounmap:
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
@ -943,7 +943,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev)
misc_deregister(&test->miscdev); misc_deregister(&test->miscdev);
kfree(misc_device->name); kfree(misc_device->name);
kfree(test->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++) { for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
if (test->bar[bar]) if (test->bar[bar])
pci_iounmap(pdev, test->bar[bar]); pci_iounmap(pdev, test->bar[bar]);