]> git.itanic.dy.fi Git - linux-stable/commitdiff
drivers/perf: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 10 Dec 2023 17:48:18 +0000 (18:48 +0100)
committerWill Deacon <will@kernel.org>
Tue, 12 Dec 2023 09:20:38 +0000 (09:20 +0000)
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>
Link: https://lore.kernel.org/r/85b0b73a1b2f743dd5db15d4765c7685100de27f.1702230488.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/fsl_imx9_ddr_perf.c

index 5cf770a1bc312418d6e8f7a0c05a17711bf7acf6..9685645bfe04d9ab1f084a9d0e3966d64dd68e6f 100644 (file)
@@ -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;
 }