This is a note to let you know that I've just added the patch titled ptp: Remove usage of the deprecated ida_simple_xxx API to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ptp-remove-usage-of-the-deprecated-ida_simple_xxx-ap.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 8a4821b10bb2cb3b7032e73aa8d87e2d9574c870 Author: Bo Liu <liubo03@xxxxxxxxxx> Date: Sun Sep 25 21:27:44 2022 -0400 ptp: Remove usage of the deprecated ida_simple_xxx API [ Upstream commit ab7ea1e73532247217d3e450015dd7ece966dc0e ] Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu <liubo03@xxxxxxxxxx> Link: https://lore.kernel.org/r/20220926012744.3363-1-liubo03@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Stable-dep-of: 19ae40f572a9 ("ptp: Properly handle compat ioctls") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index 92dd1c6f54f4a..25e37c2bc672b 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -176,7 +176,7 @@ static void ptp_clock_release(struct device *dev) mutex_destroy(&ptp->tsevq_mux); mutex_destroy(&ptp->pincfg_mux); mutex_destroy(&ptp->n_vclocks_mux); - ida_simple_remove(&ptp_clocks_map, ptp->index); + ida_free(&ptp_clocks_map, ptp->index); kfree(ptp); } @@ -211,7 +211,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, if (ptp == NULL) goto no_memory; - index = ida_simple_get(&ptp_clocks_map, 0, MINORMASK + 1, GFP_KERNEL); + index = ida_alloc_max(&ptp_clocks_map, MINORMASK, GFP_KERNEL); if (index < 0) { err = index; goto no_slot; @@ -311,7 +311,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, mutex_destroy(&ptp->tsevq_mux); mutex_destroy(&ptp->pincfg_mux); mutex_destroy(&ptp->n_vclocks_mux); - ida_simple_remove(&ptp_clocks_map, index); + ida_free(&ptp_clocks_map, index); no_slot: kfree(ptp); no_memory: