Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1124817ioo; Fri, 27 May 2022 01:56:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0kbSPqNiGUh9SrFCk8shu8MYiE7I4788lbZkmd741MoOuhEaahvO5wa/VefDWZQg7Gelo X-Received: by 2002:a05:6402:4411:b0:42b:a773:4800 with SMTP id y17-20020a056402441100b0042ba7734800mr15968765eda.37.1653641802234; Fri, 27 May 2022 01:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653641802; cv=none; d=google.com; s=arc-20160816; b=v3kFLwtCkMSROiKn7dalSHD+guZyXS2w8NDRHA4bzRpMKlqoCKWDnFST3FViWgkIr1 Zx2moGNmwZFjbVa4Sz8Nc1xz+Mou78AEDYWFUUGIQBvXDTehi2WUIOvgqAqXZXxQ6/HS QULCKXJqR83usrKclRJQ+CzyNmiN2q6evfaVEEe3Lt59w312XF4oYc/XdPxQdrXwxwSc W8nhCOgIoqV2EAaSAwL/CBc5UyMRleFxxWK9cNkA+/NRg9j8/Y/htquxlPV2BzBwlxgM zPddRDJEOl0nizYeslR67RSzZE5ajzmLIRncXiTOHEgdnoN/pDDxU2p7V3X99nAblknc zKaQ== 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=JaW0c7ONo8l/1odopVoRNIAPfMdqA969H3O1XW2GA+I=; b=y/3O7eIA2fR4+7iEsuBhAqCQep3bT/2ogTcn8s1YummPgT43yB2P+DwHhXeFbznHmw wdGbkK9boRTczopf8AZKG4qsi3GNLWw05WBjCE3hEbq1/c/kEr/25rP/pVqKcdS5xsJS cjyhoY0pxpsfZqLPRU1Jq+Rn/FKqyZSRKXFfaJb1QXT2RrXsav6jAas7KajA9X4faAyP WJ4YIdxx50PN+wnCdRh68oDHpZZNP32jSPdherpj9Mf2qEEHa9AJiHzfS2yvYlVZbGxl Q162k1ZL5piFOtxqu6Mzi72n4HtY3Ki6VJY4JVt9W2GGR4ftztFGEwCWWs8TH3Z9ErRJ pWng== 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 qa10-20020a170907868a00b006fea2a02361si794452ejc.371.2022.05.27.01.56.16; Fri, 27 May 2022 01:56:42 -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 S1346991AbiE0HJx (ORCPT + 99 others); Fri, 27 May 2022 03:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346512AbiE0HJ3 (ORCPT ); Fri, 27 May 2022 03:09:29 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C393F68AD for ; Fri, 27 May 2022 00:09:28 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L8bVK3lFXz1JCTR; Fri, 27 May 2022 15:07:53 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500023.china.huawei.com (7.185.36.83) 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 15:09:25 +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 15:09:25 +0800 From: keliu To: , , CC: keliu Subject: [PATCH] drivers: slimbus: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:30:53 +0000 Message-ID: <20220527073053.2402630-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: dggems703-chm.china.huawei.com (10.3.19.180) 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/slimbus/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 78480e332ab8..219483b79c09 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -250,7 +250,7 @@ int slim_register_controller(struct slim_controller *ctrl) { int id; - id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&ctrl_ida, GFP_KERNEL); if (id < 0) return id; @@ -299,7 +299,7 @@ int slim_unregister_controller(struct slim_controller *ctrl) { /* Remove all clients */ device_for_each_child(ctrl->dev, NULL, slim_ctrl_remove_device); - ida_simple_remove(&ctrl_ida, ctrl->id); + ida_free(&ctrl_ida, ctrl->id); return 0; } @@ -323,7 +323,7 @@ void slim_report_absent(struct slim_device *sbdev) sbdev->is_laddr_valid = false; mutex_unlock(&ctrl->lock); if (!ctrl->get_laddr) - ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); + ida_free(&ctrl->laddr_ida, sbdev->laddr); slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN); } EXPORT_SYMBOL_GPL(slim_report_absent); -- 2.25.1