Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1210142ioo; Fri, 27 May 2022 04:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9O0apWgHF7rtsNuPyrqYB+/NllzX8KRl0Xb0o9N//f/p0ekRhZ27L0JbpfI3+W7bs5Lbc X-Received: by 2002:a17:906:3ec1:b0:6e8:aae3:90de with SMTP id d1-20020a1709063ec100b006e8aae390demr37524256ejj.127.1653649622124; Fri, 27 May 2022 04:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653649622; cv=none; d=google.com; s=arc-20160816; b=vCLA4FuI1cGqtEhp11KjADpO/fUHiJhUeSaqK0AWmBP1WXB3lYOW8DbCXAc3dz1Ftb MeFk6I3crB+cZz1b9DK4RezUkQfGgxSDeIpHvJHTwX9eyD5djNrnbTcZeKR1MOOHcepw TIutCeaQ72MOZ084jvBgCzHVHm61uWJBmR1u8zKbleY6rhlb1FgSGZi+pVtLWUgcyNwD H5xcsg6biczEXXE1HdY8s5ajmwXOdwMxHq8e/nsIgp5dpXyumhT1ClluYIYMKJgHBiNi rt/hu8EsEF6cJf7aHSCUGvCLZSG/hQjhJAdjdIdHdLgfdkIw/XTAd2FYaaNoueMyQIeH IhJA== 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=ot7ZE+/nW7vFrE/qbJXwdHH0luQMDqmSqAPJ/uj8Qrw=; b=bMHj4evJdhstpoYE3abLIRXa25/1cHYcHYyvnUdPu6Vq+rnNam65e5n7FN3c2NRpqk Jcd//RFc7shbLN5NPGrusB1UdVQc3meGHgGu3UwyWFVT5V/b9Zm9ee6ICAG6XwxOCJp/ scD0C84n5xv7EFKZio0H5aZKA5JJljjnJb/iybUGBjwMSFZpxhBZRnV/c3XkXqd19Ayg i6NmK4VQZaopUs+tbcw8WtrJ6uibz9EtTXydAXAyr8fCRFf8SVT96igJDyaeQLyq3WV+ S5AnWKWLd1HkTqD03XPRZkQKELFL181joLFO519aElJlqMNxUYf/5DetxcfW84dEI7MM IFKw== 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 dr19-20020a170907721300b006fe8d330d6esi4251074ejc.374.2022.05.27.04.06.32; Fri, 27 May 2022 04:07:02 -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 S245714AbiE0GwP (ORCPT + 99 others); Fri, 27 May 2022 02:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbiE0GwN (ORCPT ); Fri, 27 May 2022 02:52:13 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F608C5 for ; Thu, 26 May 2022 23:52:12 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L8b6P4TgKz1JCT8; Fri, 27 May 2022 14:50:37 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500021.china.huawei.com (7.185.36.109) 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:52:10 +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:52:10 +0800 From: keliu To: , CC: keliu Subject: [PATCH] drivers: spmi: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:13:38 +0000 Message-ID: <20220527071338.2359733-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/spmi/spmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c index b37ead9e2fad..8a2a33876944 100644 --- a/drivers/spmi/spmi.c +++ b/drivers/spmi/spmi.c @@ -35,7 +35,7 @@ static void spmi_ctrl_release(struct device *dev) { struct spmi_controller *ctrl = to_spmi_controller(dev); - ida_simple_remove(&ctrl_ida, ctrl->nr); + ida_free(&ctrl_ida, ctrl->nr); kfree(ctrl); } @@ -440,7 +440,7 @@ struct spmi_controller *spmi_controller_alloc(struct device *parent, ctrl->dev.of_node = parent->of_node; spmi_controller_set_drvdata(ctrl, &ctrl[1]); - 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 SPMI controller identifier.\n"); -- 2.25.1