From patchwork Wed Nov 1 09:38:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 160491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp289533vqx; Wed, 1 Nov 2023 02:38:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+ZMQQPN+xdCr5rmNUBFCkJoroXZpiR6ev8neJqHMhs2N0P4r+Uyz5aYwcDVWoaqNZrZdA X-Received: by 2002:a17:902:d505:b0:1cc:5ce4:f64d with SMTP id b5-20020a170902d50500b001cc5ce4f64dmr7117086plg.15.1698831501919; Wed, 01 Nov 2023 02:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698831501; cv=none; d=google.com; s=arc-20160816; b=n31FWBIn7ryha3i4N8XtcsJbrhLOrhnYC98VbfjOJnzo7zUuZ9oUuk9h+vNGMGUZ8A XuRMWhQ9iiMxrptpDIOV/yq5TRMmmwsKwg/IDjwIHTrzRgU8v77CjgtXNC1M7HPJlzQV Dq7IroeEKsTpHEKbEVFpfqS4i5Qe3qGNldLes3+QWkofEDsIFonbKX/cFTdm5QJg7Zvc 88r3u2aZgBuPQ1nn27vo6Y2lP3jVE4eVGCXVfXxzflfY/VD63vj5gS3ui7QIUZUxkGi0 ldqxEQu9oBBpQdkQyCreJ6P95q6FD3SExHDYGKYCvB/+iytFtohKtIyhIAOxmdhRTd8d qEjQ== 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:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id kv6-20020a17090328c600b001c62e8c0a38si2613324plb.256.2023.11.01.02.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:38:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; 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:8 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 fry.vger.email (Postfix) with ESMTP id B77DC80952F0; Wed, 1 Nov 2023 02:38:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjKAJiI (ORCPT + 35 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 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:38:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781353940938389336 X-GMAIL-MSGID: 1781353940938389336 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; } }