Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp784648rdb; Wed, 1 Nov 2023 02:38:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVCzkoeX0Y8krOo6vuhcHi6iy7ntidTBf+UEtwYTeD7w8XVjVFLN/Rj2G9GgsnZiPe1x5r X-Received: by 2002:a05:6a00:a27:b0:6b5:26ef:3261 with SMTP id p39-20020a056a000a2700b006b526ef3261mr17800784pfh.16.1698831498387; Wed, 01 Nov 2023 02:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698831498; cv=none; d=google.com; s=arc-20160816; b=E8Z31roNPkK/9Kp78SGigYCcZgUkXI+HWm97pUSRuRZ5Wct2/NvwbCX3G3NotO35w0 /CZAhVcqiWK23Fmz1W0kSeU2eRTHQn/Aa1ZQkGwuugYlE3DE/nCi/yOVMjWORtxR3SnT dAuTqYc4s1oNQgVusjK7YlmoSZXDnrlItLt8SyeRo3mIfB2CwqDY6cCGGswQcWphcE+q bzecHLxmnAHH/fIGuzQd8HJOBqw6MCzBCzV1CE8vnOLgHuYyGKekfh3/gBNvztYupKtQ 5VWAK61HdQNhvy3/iWfdeoCp3WEqwrQfQ4OfaxJI+CZ7bqlQcu624zKUIx5tM3Mm6mtQ IqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ad2YBC4kdC7h9yIQ+wHLqq1yakTOU/H6sF4OhosOPYI=; fh=KnnH8SnMttOUOH0JTwY7puXG6WLUYt8/PvpFQ1JlHOk=; b=yAPek/O8Tq9KeJICxNiZ0zg/ZW9XxihXfy0+3IZuLHOIzLaJGBfMN4FRv1JClULRDD DDcwizgEhpRi72AsgIOWtSP3MHSPC5MRn+UMcpFvKS7B0B7dkhjuN7AsBL2xaQS+hkTz ZXAXgzgBqDw4MyYiX3jYVwGWdl+m8FrMAbSvrj8GIqGvPqTTemW4EWEQFLCyONUoh+gq 1qlAUMBpwGAGZvUhSwMDcZmf2Hv3b/H7obyc0htDeKw3nxbt6QkU7JNQKdpzPtTSRDDR xGNg0S8muWuH1RtJx6iOqfMVeUuq0vGSOLYp+cUcQPvYR9pyQxuGdMWDx7edPFvU8ZUM QonA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Rk+wJHPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y26-20020aa7943a000000b0069026fd5a48si1195989pfo.34.2023.11.01.02.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Rk+wJHPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B2B0A8065C9C; Wed, 1 Nov 2023 02:38:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbjKAJiI (ORCPT + 99 others); Wed, 1 Nov 2023 05:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjKAJiH (ORCPT ); Wed, 1 Nov 2023 05:38:07 -0400 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2313EF3 for ; Wed, 1 Nov 2023 02:38:05 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y7fmqyDrRdFbKy7fnqnDdw; Wed, 01 Nov 2023 10:38:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698831483; bh=ad2YBC4kdC7h9yIQ+wHLqq1yakTOU/H6sF4OhosOPYI=; h=From:To:Cc:Subject:Date; b=Rk+wJHPWYeECroi7Y+yzItW+7eeAsQBmnZwcuGilA1G2EXtphCiOolBwEPBPvy0tA B+6fmnkP1O1nS8hfLaARQKPxd7pien4SUiq3UGMmOsVUDe6EO4L/08+rAojMtBjr+a D80s1PqL6T60vEjOh0CZ2vvFN2Ml3ui3ZjSNxTPxoOGwcOB5Ma54GwkwJ8Loy6FMn1 fsnGw5mgMqx0ASLcvkvKKjCDw3Zk9kbXU7mp9+iAEwiyjNwEICdEoWs8+WxkaZWmsN BFtsHKnR236AGEUiLJD+No//GM1TFewr92SN4hEQPy83ktf/hQBymgzS9GRB+8P2Fu k03XqWn7PjICw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 10:38:03 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Jiri Kosina , Benjamin Tissoires Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-input@vger.kernel.org Subject: [PATCH] HID: sony: Remove usage of the deprecated ida_simple_xx() API Date: Wed, 1 Nov 2023 10:38:00 +0100 Message-Id: <19b538bc05c11747a3dd9fa204fde91942063d52.1698831460.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:38:16 -0700 (PDT) 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/hid/hid-sony.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index ebc0aa4e4345..55c0ad61d524 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1844,8 +1844,7 @@ static int sony_set_device_id(struct sony_sc *sc) * All others are set to -1. */ if (sc->quirks & SIXAXIS_CONTROLLER) { - ret = ida_simple_get(&sony_device_id_allocator, 0, 0, - GFP_KERNEL); + ret = ida_alloc(&sony_device_id_allocator, GFP_KERNEL); if (ret < 0) { sc->device_id = -1; return ret; @@ -1861,7 +1860,7 @@ static int sony_set_device_id(struct sony_sc *sc) static void sony_release_device_id(struct sony_sc *sc) { if (sc->device_id >= 0) { - ida_simple_remove(&sony_device_id_allocator, sc->device_id); + ida_free(&sony_device_id_allocator, sc->device_id); sc->device_id = -1; } } -- 2.34.1