mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
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>
This commit is contained in:
parent
62e56ef57c
commit
ab7ea1e735
1 changed files with 3 additions and 3 deletions
|
@ -174,7 +174,7 @@ static void ptp_clock_release(struct device *dev)
|
||||||
mutex_destroy(&ptp->tsevq_mux);
|
mutex_destroy(&ptp->tsevq_mux);
|
||||||
mutex_destroy(&ptp->pincfg_mux);
|
mutex_destroy(&ptp->pincfg_mux);
|
||||||
mutex_destroy(&ptp->n_vclocks_mux);
|
mutex_destroy(&ptp->n_vclocks_mux);
|
||||||
ida_simple_remove(&ptp_clocks_map, ptp->index);
|
ida_free(&ptp_clocks_map, ptp->index);
|
||||||
kfree(ptp);
|
kfree(ptp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
|
||||||
if (ptp == NULL)
|
if (ptp == NULL)
|
||||||
goto no_memory;
|
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) {
|
if (index < 0) {
|
||||||
err = index;
|
err = index;
|
||||||
goto no_slot;
|
goto no_slot;
|
||||||
|
@ -332,7 +332,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
|
||||||
mutex_destroy(&ptp->tsevq_mux);
|
mutex_destroy(&ptp->tsevq_mux);
|
||||||
mutex_destroy(&ptp->pincfg_mux);
|
mutex_destroy(&ptp->pincfg_mux);
|
||||||
mutex_destroy(&ptp->n_vclocks_mux);
|
mutex_destroy(&ptp->n_vclocks_mux);
|
||||||
ida_simple_remove(&ptp_clocks_map, index);
|
ida_free(&ptp_clocks_map, index);
|
||||||
no_slot:
|
no_slot:
|
||||||
kfree(ptp);
|
kfree(ptp);
|
||||||
no_memory:
|
no_memory:
|
||||||
|
|
Loading…
Reference in a new issue