Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp: Remove usage of the deprecated ida_simple_xxx API

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@inspur.com>
Link: https://lore.kernel.org/r/20220926012744.3363-1-liubo03@inspur.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Bo Liu and committed by
Jakub Kicinski
ab7ea1e7 62e56ef5

+3 -3
+3 -3
drivers/ptp/ptp_clock.c
··· 174 174 mutex_destroy(&ptp->tsevq_mux); 175 175 mutex_destroy(&ptp->pincfg_mux); 176 176 mutex_destroy(&ptp->n_vclocks_mux); 177 - ida_simple_remove(&ptp_clocks_map, ptp->index); 177 + ida_free(&ptp_clocks_map, ptp->index); 178 178 kfree(ptp); 179 179 } 180 180 ··· 217 217 if (ptp == NULL) 218 218 goto no_memory; 219 219 220 - index = ida_simple_get(&ptp_clocks_map, 0, MINORMASK + 1, GFP_KERNEL); 220 + index = ida_alloc_max(&ptp_clocks_map, MINORMASK, GFP_KERNEL); 221 221 if (index < 0) { 222 222 err = index; 223 223 goto no_slot; ··· 332 332 mutex_destroy(&ptp->tsevq_mux); 333 333 mutex_destroy(&ptp->pincfg_mux); 334 334 mutex_destroy(&ptp->n_vclocks_mux); 335 - ida_simple_remove(&ptp_clocks_map, index); 335 + ida_free(&ptp_clocks_map, index); 336 336 no_slot: 337 337 kfree(ptp); 338 338 no_memory: