Skip to content

Commit 130f335

Browse files
tititiou36kwilczynski
authored andcommitted
misc: pci_endpoint_test: 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/47a30441242c4d5f0e00555cbddd7783350ff1b2.1702966523.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 0eccea7 commit 130f335

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/misc/pci_endpoint_test.c

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

861861
pci_set_drvdata(pdev, test);
862862

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

909909
err_ida_remove:
910-
ida_simple_remove(&pci_endpoint_test_ida, id);
910+
ida_free(&pci_endpoint_test_ida, id);
911911

912912
err_iounmap:
913913
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
@@ -943,7 +943,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev)
943943
misc_deregister(&test->miscdev);
944944
kfree(misc_device->name);
945945
kfree(test->name);
946-
ida_simple_remove(&pci_endpoint_test_ida, id);
946+
ida_free(&pci_endpoint_test_ida, id);
947947
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
948948
if (test->bar[bar])
949949
pci_iounmap(pdev, test->bar[bar]);

0 commit comments

Comments
 (0)