From patchwork Thu Jan 11 20:31:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13517780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62F7EC4707B for ; Thu, 11 Jan 2024 20:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=89Jn+ANZCMF6lRrKAgACOxnk4ld68ru5nAhh/EDeyrQ=; b=LbHPtHkGSYQQok Y3FN2t0Pz3NTWE0/zoV61YjJPk6dDYtILjUViUAhzfeWIN3ksDbmW/YTTPTORyTQvv68tbAvc/klg s+rkypH++WnssC/KmjPKyCRDd0vJ+pJp9Bpg7rGIuIX7Uyf3E9gZiwwgZNUpPfkXTjU5dB2IeLLg8 pb3/NoOhZIWdd1C7D3moF603wb2QYAEtiu43ghSYPT8V61cVYUUVA2u6st58tS5M6aD0AookmGKVm KzFC72rKuPsGeTMXg18B7m4A0JFbiVvhaVSSzBoJ0j7tnwlowca5t6qo4JeXHYs/worBprqz3cEj5 +5pUqap4eGHJpBkLVC9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rO1il-001AM9-2S; Thu, 11 Jan 2024 20:32:11 +0000 Received: from smtp-18.smtpout.orange.fr ([80.12.242.18] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rO1ih-001AL9-1V for linux-arm-kernel@lists.infradead.org; Thu, 11 Jan 2024 20:32:10 +0000 Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id O1iWrSNLt6p30O1iXrV0h9; Thu, 11 Jan 2024 21:32:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705005120; bh=O2DYDashidxiDL9JfucZnb4Q1U6o1/c9c4N52fUOZ40=; h=From:To:Cc:Subject:Date; b=WZVfKSijE3zLkgf6h9UU5hqJimHJ1XnQOS4kF/Ve5HvnDkzSESmXeoKlmwJirdoi1 pEiPAS8bQ1ooXJUVzgWMTKwO8oX9/7lk32+kjESqsPjveyy9jdPvAQR6Vk+SqJykZx ZA1Nusw+Keo9MNMfxDSHLolo36WneHMclOjRzW1ixeIWouWCWZe7UtdbyHV1d34zDU dksFZvIFDEAaYENIFPzQGDxkbsbkT9B6sAi0AoQa2hEq2TRU1o6z4N4DukZB01KGjC EgdcDvRc0im1eP8QmbljvFL+TuN4XJu7LHvwyrEHRbFkMlSAj68oUsMs4xF+BkB2+Q pBCv46G2m95xw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 11 Jan 2024 21:32:00 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: imx: Remove usage of the deprecated ida_simple_xx() API Date: Thu, 11 Jan 2024 21:31:55 +0100 Message-Id: <5807287732785d81b9c3ef9e6a25e4f3bc2e2159.1705005016.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240111_123208_730277_46B6A3A4 X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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;