]> git.itanic.dy.fi Git - linux-stable/commitdiff
dw-xdata: Remove usage of the deprecated ida_simple_*() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 19 Dec 2023 06:09:54 +0000 (07:09 +0100)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Sun, 31 Dec 2023 11:09:26 +0000 (11:09 +0000)
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>
drivers/misc/dw-xdata-pcie.c

index 257c25da5199600d55371429a0458a4a97239e5a..efd0ca8cc925d177332ccc5623e48bb437f40d06 100644 (file)
@@ -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;
@@ -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;
 }
@@ -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[] = {