From patchwork Wed Nov 1 09:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 160489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp287831vqx; Wed, 1 Nov 2023 02:33:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPHh2EgIHiy2lzzhvuh3yfDP1EdBbdxUKx4jFIRC1uBY8rBGDMh3tkVcA785r4DUUI0x9s X-Received: by 2002:a05:6a20:4425:b0:179:f79e:8615 with SMTP id ce37-20020a056a20442500b00179f79e8615mr20815196pzb.52.1698831224435; Wed, 01 Nov 2023 02:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698831224; cv=none; d=google.com; s=arc-20160816; b=pfLN57hYwnmBfyu1H4HpzG2VHvq+e1TUbBYQwBw774AR7F6qe/cOW3SFAsj16G5P/0 ll1t660yoE9Iu3lrONwYp98AkVYUwJFmOkQ8nVC/AwcWNtc+TZqwKokVCBk2dtJbWKSq HBl+AN8/aFeUX5qYKyf9kaEKWpTYuynrJe9tMTZv2AhKipVcFQb5ZftQAC2S7/PWjLrS tM2fZjZ/mPQuXacoCCqH8Lw1vb4ndwf81z8PdwJ4kGrrNZsd8TukjibHNxqNXiV0yMZm Y7d/2WNzS8qyT4PR9Xpb0lgx2sCrl3iF1+PvhnqzNTIzRbM5nkBWErpdBRKdWHV94GlF Js5A== 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=Lk6by+apJlXOTJCfTgHSgCgxJ2Nx6rTRDAgAWtwwfU4=; fh=g8ccDlywEYBRVAJbvog43ZCMrjgVPqU1Gkn4cLKIh10=; b=qq9npquZtMwYYMAMcJiNcE3WHrEmsv8Fj6xpiq+EnRNioQafPOz15HKaMhhqxkhhtG gUDYqKn1d8CplXmVg7Tez8p8aZF08yOCRJn7gLSSVACEVgqwc07je7lSe1173cLXjkHx MN/lS2ltPO5FlPmmglQh07M7Pe0D8lyvocig5ytDosht6cJSdkyvzhZwHvcg3SVwuV2R 2UA9i2bLXFMRAuEsAJ604cmmZ0UnGXIy9byUknoV5SFbGBhwlvky6OW3owkVFcUuWrz/ vex0PZlMViNBC3Gbbsm6m5I6OxklV2i2gfac9pwH4gcXV+VWG6qRDnj0578mSSIfIZuY uTgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=BbVBnsZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e6-20020a17090ab38600b0027491203b43si435193pjr.189.2023.11.01.02.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=BbVBnsZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 9911C804B03C; Wed, 1 Nov 2023 02:33:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjKAJdn (ORCPT + 35 others); Wed, 1 Nov 2023 05:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjKAJdm (ORCPT ); Wed, 1 Nov 2023 05:33:42 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C054C2 for ; Wed, 1 Nov 2023 02:33:39 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y7bUqR7n2QRiPy7bUqGpjn; Wed, 01 Nov 2023 10:33:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698831217; bh=Lk6by+apJlXOTJCfTgHSgCgxJ2Nx6rTRDAgAWtwwfU4=; h=From:To:Cc:Subject:Date; b=BbVBnsZmRk2OMHr0SyJFrkLIzjmbNG6017Q+W8zqghSIP2TMIyMLZArrpLCPxvnF5 4x7t+NAHTlbmCfMcwD5W2LI8bqKszLrscaC2+j+/BbVhqNtNHs1TRVGKHVHnac8zEz dgajdDB/wKaW5JtsL4GXQnfLhIqLFiSY5OcL/a3tOQvqv31nOLhYOLl9c3hJpVXB9D IlCfF5Xk+5iRalotiMUMGdCId+VOoxodLNLCrWDIYUOFKqhidUyWi9xLgpZ52Dxpeq Ff1cGFU0RPUELO5nH2cwprGhHxZSZ421QjYbTQkJ0KasVPcsglOikh5gQ7kC0Ij1Lf S+tGPGydgTuIQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 10:33:37 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] base: soc: Remove usage of the deprecated ida_simple_xx() API Date: Wed, 1 Nov 2023 10:33:33 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:33:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781353650244949863 X-GMAIL-MSGID: 1781353650244949863 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/base/soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 8dec5228fde3..c741d0845852 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -106,7 +106,7 @@ static void soc_release(struct device *dev) { struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); - ida_simple_remove(&soc_ida, soc_dev->soc_dev_num); + ida_free(&soc_ida, soc_dev->soc_dev_num); kfree(soc_dev->dev.groups); kfree(soc_dev); } @@ -155,7 +155,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr soc_attr_groups[1] = soc_dev_attr->custom_attr_group; /* Fetch a unique (reclaimable) SOC ID. */ - ret = ida_simple_get(&soc_ida, 0, 0, GFP_KERNEL); + ret = ida_alloc(&soc_ida, GFP_KERNEL); if (ret < 0) goto out3; soc_dev->soc_dev_num = ret;