Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2397158ioo; Sat, 28 May 2022 12:20:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqJe+VLr1PHpJnxElF4XBMBzpn65QchJnll5euHPHfZtU2+5uBr3ODbyXB2KinbP43Qrgq X-Received: by 2002:a05:6a00:a94:b0:4fd:c14b:21cb with SMTP id b20-20020a056a000a9400b004fdc14b21cbmr49834632pfl.53.1653765601715; Sat, 28 May 2022 12:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653765601; cv=none; d=google.com; s=arc-20160816; b=XJHd5jvyA5bKSa1StlgO3MzB8+xzRghN6wDbXuuU1I02DIewdVoVEZaUqcjlMVXA4g YxDZ35ZgXhDaD48g/FBQIzrbLD3Tdf2XWVpSSldjjAKQgH5qTm3a8hpuCvIP7RyU7UcI P6lqzupIMKlA7W4jtImEKsik+0PX1JxdhZDsJ7LxiydStcbsp/4vxzoJWX1Ycg2KNl/Q q+1ghtMWOmcrOY45KM+YpQI7zZX1Hec7g2icRz41MVjSRir4sfSf3z7PyvUnsL/Hj63y zmvd3RSV4zAXRFy6fa+mvFJ78c2kpJ9vmUyT9wlUi+8rmO4LAtA/CikutZJh7UdZHUMU CS1A== 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=q8FJfq76IWOUP4/A+ZVQ9eILoxyMsfiTR4GYxeSQvms=; b=owFxJsgU5BFRKyJy1BCuoB6axoM3RiZ8q2NcW/RrPwOtNq9xpLBHQXKUy5IqgPM0uD 7C8wr7CVOjb3D3RmPKMpzs7PQbR9cRMN/N/n1z8ocpzUK0kDWKp4qu6F4CWwGUOpgIhA SB3Sf4bkP1prnBidzcG9t4NSKRWdwBNI0gHbvgguEI9Dd+UHs5GMeFOjGGQ8Vv7r18f4 D7jhy/gim4NhWrUr10p+i91fFobvJodPj2A07kcDRDJi+Y+KyTnzi7TaK240gUfEgbi2 U2zvV76W78uVSJeyV+ABVycp/UTOO8NxMNtzFN1bJCY16cCwL/FbH/LaYfYGfF/Cniag XB2A== 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 200-20020a6304d1000000b003fa1591abfdsi12879503pge.867.2022.05.28.12.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:20:01 -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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D9A4D27FC0; Sat, 28 May 2022 11:52:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245730AbiE0Ghy (ORCPT + 99 others); Fri, 27 May 2022 02:37:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiE0Ghu (ORCPT ); Fri, 27 May 2022 02:37:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9E0E2771; Thu, 26 May 2022 23:37:49 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L8Zm553FJzRhQZ; Fri, 27 May 2022 14:34:45 +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; Fri, 27 May 2022 14:37:47 +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:37:47 +0800 From: keliu To: , , , , CC: keliu Subject: [PATCH] serdev: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 06:59:16 +0000 Message-ID: <20220527065916.2359005-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=-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: keliu --- drivers/tty/serdev/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 0180e1e4e75d..213f8cb99661 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -75,7 +75,7 @@ static bool is_serdev_device(const struct device *dev) static void serdev_ctrl_release(struct device *dev) { struct serdev_controller *ctrl = to_serdev_controller(dev); - ida_simple_remove(&ctrl_ida, ctrl->nr); + ida_free(&ctrl_ida, ctrl->nr); kfree(ctrl); } @@ -486,7 +486,7 @@ struct serdev_controller *serdev_controller_alloc(struct device *parent, if (!ctrl) return NULL; - id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&ctrl_ida, GFP_KERNEL); if (id < 0) { dev_err(parent, "unable to allocate serdev controller identifier.\n"); -- 2.25.1