Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1446330ioo; Fri, 27 May 2022 08:46:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQwu4ZNX/OfazD6ijHVsAKZMDCp5W7b1EsXuH1RCNg7SM/AW0yzQMEiTlkRyrc7K2acqAI X-Received: by 2002:a17:907:7207:b0:6ff:d25:ee3f with SMTP id dr7-20020a170907720700b006ff0d25ee3fmr13993805ejc.389.1653666401631; Fri, 27 May 2022 08:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653666401; cv=none; d=google.com; s=arc-20160816; b=K1cHAEmQq6e8s+93x0Ku+xJZ5zNEplgr1rrFW1WZ7wNw1kjj75+XvdMh2sa7gL3TYN DhKqtSWdbBywmS5rEhSZ3LVz0uUxpCzHOk36NdbPhiu/L8ovlGm+m96STZLwWoh4nj55 bkkWxxOjINOoBqVwxVli3n08dlqPjXugo47SLmJZX0umeEsLABbDdXElzHxFzSTqbVf7 9Lp4SoV9zz0LcsNZPBHi8ywWudHLDyN5vudN5w9zjcnxODTqRPT+RL/3zIAvQL0f0WzI t2Yadokhqh1xvVAzEL5dcOSKBznC/pokkLaBGGikQFQlpAbMN4+6Tp9/Z+mK/2rQmJkL 2jSA== 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=3HtCKHH7vDAn05QP8wOZmDVx/qB2SN4bz9jsOnxpq+c=; b=YKPbvvgA6gsLPG76l1o2ti31EkXDGIjw3E1LYR0cAfhgDBhFPytayq7tzSHJlgYbrz 1cPazxF+AKFAXVHbt1E2AVdBj/ghAAAGASAOWtT6y7fqyRW+DvYjCFv4KhN4uO3TAlMO ZOHt7TcHXXSSXA+N4LCx5LFbz10Mpk/qbwLEcnOab3sK75KFQEf6LkHZaejvh49LSZHI xroDL8kEnXN88EFW/oJKNdY42qo2CNyHi0azw0fOALXKenGDlRNBaDTUp8i/dfNVmsNR lGJidHflHhTj6NJhCMo7F7kp5GL/XV52bSQXK0QhhFjOZzwlH7zC7Pd4/eHO2BTpcUGW szUw== 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 t21-20020aa7db15000000b0042aca1d821csi4177253eds.419.2022.05.27.08.46.12; Fri, 27 May 2022 08:46:41 -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 S1344604AbiE0Gzu (ORCPT + 99 others); Fri, 27 May 2022 02:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234917AbiE0Gzt (ORCPT ); Fri, 27 May 2022 02:55:49 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B1FB7FB for ; Thu, 26 May 2022 23:55:48 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L8bCT2T1WzjX4r; Fri, 27 May 2022 14:55:01 +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:55:46 +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:55:45 +0800 From: keliu To: , , , CC: keliu Subject: [PATCH] drivers: phy: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:17:14 +0000 Message-ID: <20220527071714.2359990-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: dggems704-chm.china.huawei.com (10.3.19.181) 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/phy/phy-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 91e28d6ce450..7115727476dc 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -910,7 +910,7 @@ struct phy *phy_create(struct device *dev, struct device_node *node, if (!phy) return ERR_PTR(-ENOMEM); - id = ida_simple_get(&phy_ida, 0, 0, GFP_KERNEL); + id = ida_alloc(&phy_ida, GFP_KERNEL); if (id < 0) { dev_err(dev, "unable to get id\n"); ret = id; @@ -1180,7 +1180,7 @@ static void phy_release(struct device *dev) phy = to_phy(dev); dev_vdbg(dev, "releasing '%s'\n", dev_name(dev)); regulator_put(phy->pwr); - ida_simple_remove(&phy_ida, phy->id); + ida_free(&phy_ida, phy->id); kfree(phy); } -- 2.25.1