* [PATCH] dw-xdata: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-19 6:09 Christophe JAILLET
2023-12-31 11:15 ` Krzysztof Wilczyński
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-19 6:09 UTC (permalink / raw)
To: Gustavo Pimentel, Arnd Bergmann, Greg Kroah-Hartman
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-pci
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().
This is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/misc/dw-xdata-pcie.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/dw-xdata-pcie.c b/drivers/misc/dw-xdata-pcie.c
index 257c25da5199..efd0ca8cc925 100644
--- a/drivers/misc/dw-xdata-pcie.c
+++ b/drivers/misc/dw-xdata-pcie.c
@@ -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[] = {
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dw-xdata: Remove usage of the deprecated ida_simple_xx() API
2023-12-19 6:09 [PATCH] dw-xdata: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-12-31 11:15 ` Krzysztof Wilczyński
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-31 11:15 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Gustavo Pimentel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel,
kernel-janitors, linux-pci
Hello,
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
>
> This is less verbose.
Applied to remove-old-api, thank you!
[1/1] dw-xdata: Remove usage of the deprecated ida_simple_*() API
https://git.kernel.org/pci/pci/c/0171e067d7da
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-31 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 6:09 [PATCH] dw-xdata: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-31 11:15 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox