drivers/perf: Remove usage of the deprecated ida_simple_xx() API
Subsystems (4)
PATCH 1/1 drivers/perf: Remove usage of the deprecated ida_simple_xx() API
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 <[email protected]>
--- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/perf/fsl_imx9_ddr_perf.c +3 -3
@@ -617,7 +617,7 @@ static int ddr_perf_probe(struct platform_device *pdev)platform_set_drvdata (pdev, pmu); - pmu->id =ida_simple_get (&ddr_ida,0 ,0 ,GFP_KERNEL ); + pmu->id =ida_alloc (&ddr_ida,GFP_KERNEL ); name =devm_kasprintf (&pdev->dev,GFP_KERNEL ,DDR_PERF_DEV_NAME "%d" , pmu->id);if (!name) { ret = -ENOMEM ;
@@ -674,7 +674,7 @@ static int ddr_perf_probe(struct platform_device *pdev)cpuhp_remove_multi_state (pmu->cpuhp_state); cpuhp_state_err: format_string_err: -ida_simple_remove (&ddr_ida, pmu->id); +ida_free (&ddr_ida, pmu->id);dev_warn (&pdev->dev,"i.MX9 DDR Perf PMU failed (%d), disabled\n" , ret);return ret; }
@@ -688,7 +688,7 @@ static int ddr_perf_remove(struct platform_device *pdev)perf_pmu_unregister (&pmu->pmu); -ida_simple_remove (&ddr_ida, pmu->id); +ida_free (&ddr_ida, pmu->id);return 0 ; }
Signature · 1 line
2.34.1
Quoted 6 lines · Christophe JAILLET
ida_alloc()andida_free()should be preferred to the deprecatedida_simple_get()andida_simple_remove().This is less verbose.
Applied to will (for-next/perf), thanks!
[1/1] drivers/perf: Remove usage of the deprecated ida_simple_xx() API
https://git.kernel.org/will/c/79c03ed4b896
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev