Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp218960rwb; Sun, 25 Sep 2022 19:08:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kUyyLaxd2uiD3Na/WtRWSftZU9OBWeHVJfdDUR4A0bVT2NMmF1c6y8tsIFycDF/ImpigZ X-Received: by 2002:a05:6a00:21c2:b0:52b:ff44:6680 with SMTP id t2-20020a056a0021c200b0052bff446680mr21250606pfj.57.1664158086390; Sun, 25 Sep 2022 19:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664158086; cv=none; d=google.com; s=arc-20160816; b=sL0cVfOZ2G306yzJmx0Miis8EZSEtHscTLMYkfXG8wGDG6d43a7QJarPIC7YtChhyC Ng/vqkCHCgMJs/HFCeEr2Hs3piAhOU566Td3XSZVwUVyaRx2DjLasYBd/DJvzmkG5r8S pCj0lPtuQRo2C9NsBFt66sS90+xFtHertW3HoaC31kdUC6hg8CuWXTIvjr0dO5+Zh214 mz8yR8T1w9wIKqwRgl0JyaZySqQ801XGFBz6ZKehI22zTdvRD5kh0cWRgQL3ZZJxrLq1 fYP4wGheB4p5o897P2wN0MtjjjVGvvCBBCKxsHFL6+9J/5bPf/e1sx34TOr+Ulkb4GNB kIFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:mime-version:message-id :date:subject:cc:to:from; bh=mh+fl7PtrIQqOYR+6RC3FFMGXoekotIznzFOsK6A7Kg=; b=zs/LbCS5FV4FiI2MdE8jWVtsgr0hWVpYMW/4Al4Hpl8UIAvnSvW7QVD1bJP/A9J1dt HbR6gWM07j3JnTfWEHyZgRSyJnFcH88cH54KT9KjbELwO/VETmThy9aXjU5HjGlauNFm 01wpbtTEC9mngqJ9KegM4GxRi2SBR0mHehWLTy6nPHD0K3hUd5BCJyujBIotGL2/Ve8/ Ncmt0i9fmBTpDjaaJGGNZc85W2VlW2BNDyFsbhaCp/iNEDgj0IBuBBTxcrsmBqGkP3T2 SVtIHaA8+n0E3Mfy0wL588+KS23iinICyNQwRmJsx2lLDGyegXn77v1zkXFNJoDmDLut QI6Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a655787000000b0042db630d173si18540588pgr.480.2022.09.25.19.07.48; Sun, 25 Sep 2022 19:08:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbiIZB2E (ORCPT + 99 others); Sun, 25 Sep 2022 21:28:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233248AbiIZB1y (ORCPT ); Sun, 25 Sep 2022 21:27:54 -0400 Received: from ssh248.corpemail.net (ssh248.corpemail.net [210.51.61.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19BC72B269; Sun, 25 Sep 2022 18:27:50 -0700 (PDT) Received: from ([60.208.111.195]) by ssh248.corpemail.net ((D)) with ASMTP (SSL) id UAB00147; Mon, 26 Sep 2022 09:27:47 +0800 Received: from localhost.localdomain (10.200.104.97) by jtjnmail201612.home.langchao.com (10.100.2.12) with Microsoft SMTP Server id 15.1.2507.12; Mon, 26 Sep 2022 09:27:47 +0800 From: Bo Liu To: CC: , , Bo Liu Subject: [PATCH] ptp: Remove usage of the deprecated ida_simple_xxx API Date: Sun, 25 Sep 2022 21:27:44 -0400 Message-ID: <20220926012744.3363-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.200.104.97] tUid: 20229260927472881b93d13ea070290ca676091240bcf X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu --- drivers/ptp/ptp_clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index 688cde320bb0..51cae72bb6db 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -174,7 +174,7 @@ static void ptp_clock_release(struct device *dev) mutex_destroy(&ptp->tsevq_mux); mutex_destroy(&ptp->pincfg_mux); mutex_destroy(&ptp->n_vclocks_mux); - ida_simple_remove(&ptp_clocks_map, ptp->index); + ida_free(&ptp_clocks_map, ptp->index); kfree(ptp); } @@ -217,7 +217,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, if (ptp == NULL) goto no_memory; - index = ida_simple_get(&ptp_clocks_map, 0, MINORMASK + 1, GFP_KERNEL); + index = ida_alloc_max(&ptp_clocks_map, MINORMASK, GFP_KERNEL); if (index < 0) { err = index; goto no_slot; @@ -332,7 +332,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, mutex_destroy(&ptp->tsevq_mux); mutex_destroy(&ptp->pincfg_mux); mutex_destroy(&ptp->n_vclocks_mux); - ida_simple_remove(&ptp_clocks_map, index); + ida_free(&ptp_clocks_map, index); no_slot: kfree(ptp); no_memory: -- 2.27.0