Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2316187ioo; Sat, 28 May 2022 09:59:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwySkjlrtAoT4PckPzni66lEocUVOgIvJSZIAy04xMClijY7kUK6jFN8CaUz0e/7mpuPZd X-Received: by 2002:a17:907:7f03:b0:6ff:4721:3c75 with SMTP id qf3-20020a1709077f0300b006ff47213c75mr5025160ejc.508.1653757148098; Sat, 28 May 2022 09:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653757148; cv=none; d=google.com; s=arc-20160816; b=vKykOW1JHL3OxwhDqKkCvuxF1tTU0eFTMIjOKvBszntwScrP8nz3ZoJMn4ocX4ujQI z5nH3ohhDob+KYmKrUWBaoc5C8CW9RUcu2neaNOTCKMq2CcY3FU3d44LkyMkpvHy821Z RW2lGDzkUCgUJiumtX2bhhNQhNkGyRNMZKpYvRY4xLPu9xul6qEQo2n2s88Nm5yQ0T+b p/3sjr9jx4XQFdXS7VRuwGOux2ZVB9r412CwndhiWAxG0pA/2lyo2qcatoCBaLTKoauj 9b66PErevK6shLaRV2qg+0bibKElA/0o5AZmb4VTRcdInHwOkbP+NLzh6YYSEoDip/r+ 3iRQ== 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; bh=bICOJyc0VNkOxVb92Ko2JjD1RT1MUl71dDQ8/TlFiMM=; b=m5MyI38jcmlmniVrFVvr3gwx/ijqZEMspjHgu9aAlo1+LDLLrO6L1CQizZDnOdM8Ol oTEaUVE+4ZgW9ZbrrlNXOTNrKfP6+QMffAyNuIalYa/9IIq6flzy3Zq6Vn8Fl4nxjk2t zNeeHTTAIq82Dew5CRpruWUTnNdOaq1JDHY67gEcM5LZT9TDtxMbXqADHPbBbEK+YrI1 QQboF+XSgc0QJHhSdMJw0MHNAq7YQuLhJsGQLQ1zmbnnmCWv7xGjFstRLjRe47UdNMD3 OkqsaWtCgRdq0pGDG0/CY67F8Y9HCxLEWgmKxoMpged0Fx60DebVXhFYr7tSyiM7Pt4b hetg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht19-20020a170907609300b006f8603a60b1si6971629ejc.201.2022.05.28.09.58.30; Sat, 28 May 2022 09:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244984AbiE0Grh (ORCPT + 99 others); Fri, 27 May 2022 02:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344432AbiE0Gr1 (ORCPT ); Fri, 27 May 2022 02:47:27 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6C08E2772 for ; Thu, 26 May 2022 23:47:22 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L8Zz71qCbzRhRH; Fri, 27 May 2022 14:44:19 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:47:21 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:47:20 +0800 From: keliu To: , CC: keliu Subject: [PATCH] drivers: mux: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:08:46 +0000 Message-ID: <20220527070846.2359416-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- drivers/mux/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mux/core.c b/drivers/mux/core.c index 49bedbe6316c..0f5c76109bb6 100644 --- a/drivers/mux/core.c +++ b/drivers/mux/core.c @@ -66,7 +66,7 @@ static void mux_chip_release(struct device *dev) { struct mux_chip *mux_chip = to_mux_chip(dev); - ida_simple_remove(&mux_ida, mux_chip->id); + ida_free(&mux_ida, mux_chip->id); kfree(mux_chip); } @@ -113,7 +113,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev, mux_chip->dev.of_node = dev->of_node; dev_set_drvdata(&mux_chip->dev, mux_chip); - mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL); + mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL); if (mux_chip->id < 0) { int err = mux_chip->id; -- 2.25.1