From mboxrd@z Thu Jan 1 00:00:00 1970 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 D8AA2C10F05 for ; Sun, 10 Dec 2023 17:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjLJRn5 (ORCPT ); Sun, 10 Dec 2023 12:43:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjLJRnz (ORCPT ); Sun, 10 Dec 2023 12:43:55 -0500 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7580FFA for ; Sun, 10 Dec 2023 09:44:01 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNqQrGkpo4QGMCNqQrBwSr; Sun, 10 Dec 2023 18:43:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702230239; bh=2DakXtZBtjglxJAoYvjwjPdRqQfAlWSOjON3AQhn3rc=; h=From:To:Cc:Subject:Date; b=NvTFoZCVJvQwlvL0Wn2x7DmMrz9pm1f7rxr9S2sRlJ7Ik3bHV4UDmoR2sT1tZ3gcm OGN5dfyRznLHL6WNUcAY4K1d3x/c9RO12yQNzNYKdO2620eUQkpYKn/hBxt3jmCsFY KBUVyR9wjT6ov2dsFLYBZs8HBAnJcraQEtiLDFEaQGaWuyzcAW/w6BagmKh8pcVgL0 6+A2QWM5QrASpfVdyUSXqZYIaNdFPHusarZSoUYKLNA8G9lrNfFrhNJMiimVYcs7iv mHgUbufvuYYsUodNXvagfkksysGEPcB8oTy+h87DXsEXhL++wRYWQOsXAYdCIZYMvP SXchW/Uz6p0YQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:43:59 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Peter Chen , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH] usb: chipidea: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:43:56 +0100 Message-Id: <8bf382976c0ba0986c0dbe93427266273f0776ef.1702230217.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/usb/chipidea/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 7ac39a281b8c..0af9e68035fb 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -862,7 +862,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev, if (ret) return ERR_PTR(ret); - id = ida_simple_get(&ci_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&ci_ida, GFP_KERNEL); if (id < 0) return ERR_PTR(id); @@ -892,7 +892,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev, err: platform_device_put(pdev); put_id: - ida_simple_remove(&ci_ida, id); + ida_free(&ci_ida, id); return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(ci_hdrc_add_device); @@ -901,7 +901,7 @@ void ci_hdrc_remove_device(struct platform_device *pdev) { int id = pdev->id; platform_device_unregister(pdev); - ida_simple_remove(&ci_ida, id); + ida_free(&ci_ida, id); } EXPORT_SYMBOL_GPL(ci_hdrc_remove_device); -- 2.34.1