Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2297892iof; Wed, 8 Jun 2022 01:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd6G8sipC/YBhcHNlN0g6qLxmvsD8A9+71l+K1Nm0CYEhYS/LasV1G1n6G/RJvOcLVUEdG X-Received: by 2002:a17:902:ac8f:b0:163:fbb7:b057 with SMTP id h15-20020a170902ac8f00b00163fbb7b057mr33547171plr.67.1654678078346; Wed, 08 Jun 2022 01:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654678078; cv=none; d=google.com; s=arc-20160816; b=xXkv9+L7GoC8sBskX8IisPcfvcgyil88FSth3Ynchtk2DuYDnqFkucU61fCsDkzde5 z0EdT6vDwweyb7hoPai2XQ3nnlVPzOvSM1o5NtACyz4dKeklou6AFg0yCU5PyWD2VXKf 1A4H4vxe0klyV2VX0jUEt5mpFBABoEpKgBZ41lSudTFw295tRPjXr5Blf0PyU+EJaksA F+ncnqRGufYDgWS66gvWG/jCEw/zgWe0tzpiJeYVZxxtowFUK3fpYss4eRRAw/n1CtbC 7bgxMiHLzcXnlHQI03I0DG/iIpeijoBvSFsLdbHsfRytQIbWZ0G7ThqwtL9iiyS3Y829 QVSw== 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=hrAJIr5nXs+pYtr5MLwg93fH5m4QwjqclFroaCYPmBE=; b=0je2dng7f8Sjclyx+8+IyxHP5Camnu0got5x/1n1zhNvBQf+ADLdEQWSG5FL81gB7C PBWhOZ4Ug8hSuooBi1mv3XY/IJ4KFIi5dYpykXG3OA6kbwcnWjjO1xGEQiYk4fKmgnpr W0duHJCL6LmthfhfNJN9Wm5kkW/BVUaToZgKhmNp36oMYUnsE7zT1ml3wjkQRiusrGjT qZjxNvUdpVutDnZQ8kPM4cejrfVRkDXRsXHI0Dr8GrTzQ58NI8YIHT8J3VlEZ2Ei17hi GJQFGBsSV3vXJNulF42K/jTf1VJKUETYBLQCW66+nM8SC/n+a9OAewiyLsCnflTYH6kb JXUg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w69-20020a638248000000b003fe34775ab6si1790991pgd.286.2022.06.08.01.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61D352A3A25; Wed, 8 Jun 2022 01:11:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232986AbiFHFea (ORCPT + 99 others); Wed, 8 Jun 2022 01:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbiFHFd1 (ORCPT ); Wed, 8 Jun 2022 01:33:27 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD35283E88 for ; Tue, 7 Jun 2022 20:00:23 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LHsQp0vGHz16Jj7; Wed, 8 Jun 2022 11:00:02 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 8 Jun 2022 11:00:20 +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; Wed, 8 Jun 2022 11:00:19 +0800 From: Ke Liu To: CC: , , , , Ke Liu Subject: [PATCH] misc: bcm-vk: Directly use ida_alloc()/free() Date: Wed, 8 Jun 2022 03:19:27 +0000 Message-ID: <20220608031927.1704412-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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Ke Liu --- drivers/misc/bcm-vk/bcm_vk_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c index a16b99bdaa13..a3a82ebbc699 100644 --- a/drivers/misc/bcm-vk/bcm_vk_dev.c +++ b/drivers/misc/bcm-vk/bcm_vk_dev.c @@ -1401,7 +1401,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) bcm_vk_tty_set_irq_enabled(vk, i); } - id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&bcm_vk_ida, GFP_KERNEL); if (id < 0) { err = id; dev_err(dev, "unable to get id\n"); @@ -1500,7 +1500,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) misc_device->name = NULL; err_ida_remove: - ida_simple_remove(&bcm_vk_ida, id); + ida_free(&bcm_vk_ida, id); err_irq: for (i = 0; i < vk->num_irqs; i++) @@ -1573,7 +1573,7 @@ static void bcm_vk_remove(struct pci_dev *pdev) if (misc_device->name) { misc_deregister(misc_device); kfree(misc_device->name); - ida_simple_remove(&bcm_vk_ida, vk->devid); + ida_free(&bcm_vk_ida, vk->devid); } for (i = 0; i < vk->num_irqs; i++) devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk); -- 2.25.1