ARM: imx: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 11 Jan 2024 20:31:55 +0000 (21:31 +0100)
committerShawn Guo <shawnguo@kernel.org>
Mon, 5 Feb 2024 09:23:28 +0000 (17:23 +0800)
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>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/mmdc.c

index 444a7eaa320ca7b3850504333c9febc05e301ded..25893d1091903fae1eb392c3b648117b366fb36a 100644 (file)
@@ -452,7 +452,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
                .active_events = 0,
        };
 
-       pmu_mmdc->id = ida_simple_get(&mmdc_ida, 0, 0, GFP_KERNEL);
+       pmu_mmdc->id = ida_alloc(&mmdc_ida, GFP_KERNEL);
 
        return pmu_mmdc->id;
 }
@@ -461,7 +461,7 @@ static void imx_mmdc_remove(struct platform_device *pdev)
 {
        struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev);
 
-       ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
+       ida_free(&mmdc_ida, pmu_mmdc->id);
        cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
        perf_pmu_unregister(&pmu_mmdc->pmu);
        iounmap(pmu_mmdc->mmdc_base);
@@ -529,7 +529,7 @@ pmu_register_err:
        cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
        hrtimer_cancel(&pmu_mmdc->hrtimer);
 pmu_release_id:
-       ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
+       ida_free(&mmdc_ida, pmu_mmdc->id);
 pmu_free:
        kfree(pmu_mmdc);
        return ret;