From patchwork Tue Dec 19 06:09:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13497868 X-Patchwork-Delegate: kw@linux.com Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A85DBBE79 for ; Tue, 19 Dec 2023 06:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="l4sNEkA+" Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id FTIhr2VyFBU01FTIirj4Uz; Tue, 19 Dec 2023 07:09:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702966198; bh=KTpDymoJN4gJQumbzCdvVykjTutbaVEe/yWH87l7ENk=; h=From:To:Cc:Subject:Date; b=l4sNEkA+xYvOVabsBHk5M0V29A4uXKj/0Sg02aRcWKjiQPusnJVoVkEQnl31zJhC1 1kuD5X4u/bdZgbo3J/2l+b2n2FIV25CUYmI2Mg7gyf3MYVUWRz/nHOlXmh16IneGE1 woS7spuhSBnaRrQF1/L85iKji1QV6Ohsw//Mx3Y/TNE7s2ZCCYIEaAHmfbC4zVTBe/ MpyyG9ivIqPulDzIUiAR2cL0+/2wXqUrrOxUFnbaZa75PvGxsT71I5ZIdlfS1FT4rt mXG9GWNvnUQQiX/3pmrjmTX7dItovt2Tfr95ZIKGflzxJlFEHNizqOX5BkTIuCKzlf 0gaHpwJ69r0uA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 19 Dec 2023 07:09:58 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Gustavo Pimentel , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org Subject: [PATCH] dw-xdata: Remove usage of the deprecated ida_simple_xx() API Date: Tue, 19 Dec 2023 07:09:54 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- drivers/misc/dw-xdata-pcie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/dw-xdata-pcie.c b/drivers/misc/dw-xdata-pcie.c index 257c25da5199..efd0ca8cc925 100644 --- a/drivers/misc/dw-xdata-pcie.c +++ b/drivers/misc/dw-xdata-pcie.c @@ -333,7 +333,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev, dw->pdev = pdev; - id = ida_simple_get(&xdata_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&xdata_ida, GFP_KERNEL); if (id < 0) { dev_err(dev, "xData: unable to get id\n"); return id; @@ -377,7 +377,7 @@ static int dw_xdata_pcie_probe(struct pci_dev *pdev, kfree(dw->misc_dev.name); err_ida_remove: - ida_simple_remove(&xdata_ida, id); + ida_free(&xdata_ida, id); return err; } @@ -396,7 +396,7 @@ static void dw_xdata_pcie_remove(struct pci_dev *pdev) dw_xdata_stop(dw); misc_deregister(&dw->misc_dev); kfree(dw->misc_dev.name); - ida_simple_remove(&xdata_ida, id); + ida_free(&xdata_ida, id); } static const struct pci_device_id dw_xdata_pcie_id_table[] = {