Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3711166iob; Tue, 17 May 2022 05:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHZa/n2ZQebOJl+tUhAI9Hu4jgiM3HE/cHzm+9IhwAP+Im8ccDC0AceJ1Sw7cpUZXhuznm X-Received: by 2002:a17:90b:4d90:b0:1de:b54f:c5d with SMTP id oj16-20020a17090b4d9000b001deb54f0c5dmr24398801pjb.27.1652792253000; Tue, 17 May 2022 05:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652792252; cv=none; d=google.com; s=arc-20160816; b=wMec5fa/tBZ9Vj+xcrjzMGTRpO3rVma/fA9+cNkkp1NBbgWGmbTlnJLus9e/dgv8fV L4JK4B0sV2bWyw94R6FVApctuTgUuTxDJmvy1C/tBnZXDYeMZHIlNIB712iD55PzYQLy iiyPEardG8vSp8Fu8H7VpPuTeYxjNZAwpLL/W4MhxIRTMiD3HPjfIoiyNLF8WRdASJrn mvzlKEaW9gI0a2l/+nHQXzA1GElTfDr4RaKx/hR+4dikEIPHmq0iIfI+uXVgBmMisYBA ohSksLbwzZWKpDoHtj1pmNKiz48epedCn209aGxXjJW/4HG2WwWexhGlEhxCbRbHl9MF zTMw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jLSrALEFoF0Drk7Gml+UNyUnq7XQGX27DQEgGTdNJAk=; b=jjJhN2ub99TMfHvyZtDt/cxht01JwL4XK1epTp2oGajCy08c3/jsVjhclYu6uD2dfT MAulvmWC5SXNEo6T6wSifzummKWC7S8IVEwfmFQgYLc6EVoNB0ul12vQUqZcUGqee9S/ ezqmwrQwOo8eADDoGZzGgjSfTTuy03TaQWq6BHDviWAlOf+HVl3y6mHUJ4thwjxdEHJo oEerGPYr5AVEUeyrLrQ25PkchGH1ZMPCpt3FQVoUdjdZ98nHYNmOx2sXM3GoRNfnTAri weyB3u+Q1xUPYtautq3lihUTcFtPyMbLtg8HaGol6AEG7irufsOozz6yRH88xQJKFDoQ nzgw== 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 j1-20020a17090a734100b001df2d4f406bsi2797180pjs.33.2022.05.17.05.57.19; Tue, 17 May 2022 05:57:32 -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 S239011AbiEQGNQ (ORCPT + 99 others); Tue, 17 May 2022 02:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbiEQGNM (ORCPT ); Tue, 17 May 2022 02:13:12 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 544C843EFD; Mon, 16 May 2022 23:13:10 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L2Ql461qjzhZH2; Tue, 17 May 2022 14:12:32 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 17 May 2022 14:13:07 +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; Tue, 17 May 2022 14:13:06 +0800 From: keliu To: , , , CC: keliu Subject: [PATCH 2/2] hwmon: Directly use ida_alloc()/free() Date: Tue, 17 May 2022 06:31:26 +0000 Message-ID: <20220517063126.2142637-2-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517063126.2142637-1-liuke94@huawei.com> References: <20220517063126.2142637-1-liuke94@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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/hwmon/ibmaem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index de6baf6ca3d1..5c4cf742f5ae 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c @@ -482,7 +482,7 @@ static void aem_delete(struct aem_data *data) ipmi_destroy_user(data->ipmi.user); platform_set_drvdata(data->pdev, NULL); platform_device_unregister(data->pdev); - ida_simple_remove(&aem_ida, data->id); + ida_free(&aem_ida, data->id); kfree(data); } @@ -539,7 +539,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle) data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL; /* Create sub-device for this fw instance */ - data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL); + data->id = ida_alloc(&aem_ida, GFP_KERNEL); if (data->id < 0) goto id_err; @@ -600,7 +600,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle) platform_set_drvdata(data->pdev, NULL); platform_device_unregister(data->pdev); dev_err: - ida_simple_remove(&aem_ida, data->id); + ida_free(&aem_ida, data->id); id_err: kfree(data); @@ -679,7 +679,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe, data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL; /* Create sub-device for this fw instance */ - data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL); + data->id = ida_alloc(&aem_ida, GFP_KERNEL); if (data->id < 0) goto id_err; @@ -740,7 +740,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe, platform_set_drvdata(data->pdev, NULL); platform_device_unregister(data->pdev); dev_err: - ida_simple_remove(&aem_ida, data->id); + ida_free(&aem_ida, data->id); id_err: kfree(data); -- 2.25.1