Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1702241ioo; Fri, 27 May 2022 14:56:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Zn9W+h5o6t4LKXv5bE2YV7IbsSggxnpUmQ8Gsjd+fsialMYQUfzKymZgZkKIEXzl3ySu X-Received: by 2002:a17:907:d1a:b0:6ff:16cc:2084 with SMTP id gn26-20020a1709070d1a00b006ff16cc2084mr4866399ejc.691.1653688588118; Fri, 27 May 2022 14:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653688588; cv=none; d=google.com; s=arc-20160816; b=JciCSZ4QFKI62JOuQoJZs7PK2nwuPu3kzLrKA3YzlQ/BHiRTzrT8644pMJArW0DeG/ bqIqgwTeW43ZEvloJmI8Xth23ZjDrzbV88ztOVEFzHDaNyr2NfVh9v/GxNsB54BXwfML 4DnngWvOvihpFgKt87RFWCkBDV6DYXIr4Wg0GuvF63VSm10zOEhhQ8GZCZNRUorBvJvI yZ+naVXJV6U+rFqvU4x4cMxIdaK01jamglPNfpXWbcS3BfArXaemY+GKDJWJAdLvnFa1 PQmd8SXVMucIt8R5Sy9pCz1Q9BN3C/3zXvMxmmt65WqyHInibMViq5RPCwcwnT3yeDB1 1dNQ== 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:to:from; bh=Y2QvQLS65y2UZ6/noTgLbHDW0988Wg0WBzGSQg2RRIU=; b=Ft8ZXoSMhiScRU9zEi0dsSNheRFt2UeXuigpzONAqQRzFhzMOZkZ0HriKhtDHFGWLf uWKRDpyXUx5ZVPici503MGH93jq/T1guB6dfiqiCb8v5uKyZ8yrWkuZNmK01q1eVsBQ4 stHqMXUodj1nIGgudXUWkmsqxWlDSSlhq622GxsuuJyNF4HhY5cFnL0ktUh1Z1eMNfZH 9f5PUEpPvyvIxsjQo+C8fUODvANRmgXlbUM2kiSdsMV/l5nC8JBs2Kfk4AtsTkCpeK5S 8GxE5IWcuMzJgxIZv+v6xbNmNdfXyUuc0O+CaW3OPl8KexH7RJjEioBBbh1cG6cRTlM9 HS2Q== 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 cr16-20020a170906d55000b006efe08752d0si5166688ejc.468.2022.05.27.14.55.55; Fri, 27 May 2022 14:56:28 -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 S1344725AbiE0HD4 (ORCPT + 99 others); Fri, 27 May 2022 03:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239176AbiE0HDy (ORCPT ); Fri, 27 May 2022 03:03:54 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A7926FA05 for ; Fri, 27 May 2022 00:03:53 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L8bMt5d4tz1JCSZ; Fri, 27 May 2022 15:02:18 +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 15:03:51 +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:03:51 +0800 From: keliu To: , , , , Subject: [PATCH] pps: clients: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:25:20 +0000 Message-ID: <20220527072520.2374615-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: dggems702-chm.china.huawei.com (10.3.19.179) 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/pps/clients/pps_parport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 42f93d4c6ee3..af972cdc04b5 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c @@ -148,7 +148,7 @@ static void parport_attach(struct parport *port) return; } - index = ida_simple_get(&pps_client_index, 0, 0, GFP_KERNEL); + index = ida_alloc(&pps_client_index, GFP_KERNEL); memset(&pps_client_cb, 0, sizeof(pps_client_cb)); pps_client_cb.private = device; pps_client_cb.irq_func = parport_irq; @@ -188,7 +188,7 @@ static void parport_attach(struct parport *port) err_unregister_dev: parport_unregister_device(device->pardev); err_free: - ida_simple_remove(&pps_client_index, index); + ida_free(&pps_client_index, index); kfree(device); } @@ -208,7 +208,7 @@ static void parport_detach(struct parport *port) pps_unregister_source(device->pps); parport_release(pardev); parport_unregister_device(pardev); - ida_simple_remove(&pps_client_index, device->index); + ida_free(&pps_client_index, device->index); kfree(device); } -- 2.25.1