* [PATCH] ARM: imx: Remove usage of the deprecated ida_simple_xx() API
@ 2024-01-11 20:31 Christophe JAILLET
2024-02-05 9:23 ` Shawn Guo
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-01-11 20:31 UTC (permalink / raw)
To: Russell King, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team
Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
linux-arm-kernel
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>
---
arch/arm/mach-imx/mmdc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 444a7eaa320c..25893d109190 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -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 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
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;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: imx: Remove usage of the deprecated ida_simple_xx() API
2024-01-11 20:31 [PATCH] ARM: imx: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2024-02-05 9:23 ` Shawn Guo
0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2024-02-05 9:23 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Russell King, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team, linux-kernel, kernel-janitors,
linux-arm-kernel
On Thu, Jan 11, 2024 at 09:31:55PM +0100, Christophe JAILLET wrote:
> 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>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-05 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11 20:31 [PATCH] ARM: imx: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-02-05 9:23 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox