From nobody Tue Dec 16 16:43:54 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0516BC46CA3 for ; Sun, 10 Dec 2023 17:46:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231946AbjLJRp5 (ORCPT ); Sun, 10 Dec 2023 12:45:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjLJRp4 (ORCPT ); Sun, 10 Dec 2023 12:45:56 -0500 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19FCFD for ; Sun, 10 Dec 2023 09:46:02 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNsNrgtex45wtCNsNrxdc4; Sun, 10 Dec 2023 18:46:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702230361; bh=wfIMRxTsCNGiqACgN++FPbWBDIxFPSfkoS5LG06bXxY=; h=From:To:Cc:Subject:Date; b=orOFv/GcKajVFIiAedek7oFZUFxrfMzYkdHRpGANl/6cYSoq82uxliXUF+KkdwKcL c7ibMFNTT3YGvJyjS9LuRq0eHSHVa4oz3cKh1V9rZJtZIY1slfpClUn3RnkQHIjGI3 hpGXwnlZgSelEBaQ3xLjA/TIhZxVtLJUP2P2T/WEAOYSfH8txI30kwN8pMzBb6mH3W JzFXhQKgzxwceTTZUxE/CGBlSeFap1008C8mcp7e1vdVCIJyV8W/xFbumrwASvUJY/ 10+bWMsmafB0lkvhpLYgIgC3zx51MsH/KSpDDjNIg0ujbntauByC/JzpnlhdjGioXL M3TulHQKTat5Q== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:46:01 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-serial@vger.kernel.org Subject: [PATCH] serdev: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:45:58 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/tty/serdev/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 3090e3454c44..a3c645ff4a7e 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -77,7 +77,7 @@ static bool is_serdev_device(const struct device *dev) static void serdev_ctrl_release(struct device *dev) { struct serdev_controller *ctrl =3D to_serdev_controller(dev); - ida_simple_remove(&ctrl_ida, ctrl->nr); + ida_free(&ctrl_ida, ctrl->nr); kfree(ctrl); } =20 @@ -491,7 +491,7 @@ struct serdev_controller *serdev_controller_alloc(struc= t device *host, if (!ctrl) return NULL; =20 - id =3D ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); + id =3D ida_alloc(&ctrl_ida, GFP_KERNEL); if (id < 0) { dev_err(parent, "unable to allocate serdev controller identifier.\n"); --=20 2.34.1