Skip to content

Commit 0d04e84

Browse files
tititiou36Shawn Guo
authored andcommitted
ARM: imx: 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 <christophe.jaillet@wanadoo.fr> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
1 parent 6613476 commit 0d04e84

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/arm/mach-imx/mmdc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
452452
.active_events = 0,
453453
};
454454

455-
pmu_mmdc->id = ida_simple_get(&mmdc_ida, 0, 0, GFP_KERNEL);
455+
pmu_mmdc->id = ida_alloc(&mmdc_ida, GFP_KERNEL);
456456

457457
return pmu_mmdc->id;
458458
}
@@ -461,7 +461,7 @@ static void imx_mmdc_remove(struct platform_device *pdev)
461461
{
462462
struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev);
463463

464-
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
464+
ida_free(&mmdc_ida, pmu_mmdc->id);
465465
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
466466
perf_pmu_unregister(&pmu_mmdc->pmu);
467467
iounmap(pmu_mmdc->mmdc_base);
@@ -529,7 +529,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
529529
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
530530
hrtimer_cancel(&pmu_mmdc->hrtimer);
531531
pmu_release_id:
532-
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
532+
ida_free(&mmdc_ida, pmu_mmdc->id);
533533
pmu_free:
534534
kfree(pmu_mmdc);
535535
return ret;

0 commit comments

Comments
 (0)