Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3543548rdb; Sun, 10 Dec 2023 09:48:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3G5cDBzA+gUFvMxT3ozgSTH4lQ5Bm3HDbdiQiXkvOGPlFhes6X/aoynrbkhP18jGutMUv X-Received: by 2002:a05:6a20:560c:b0:18f:a92:9152 with SMTP id ir12-20020a056a20560c00b0018f0a929152mr1272347pzc.103.1702230518409; Sun, 10 Dec 2023 09:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702230518; cv=none; d=google.com; s=arc-20160816; b=TWRG9Rnqk853I+JwtKjsD3sYcKrmMOEXXSrFm5Qw4XrlUAEK09BbgJxGl4pmX6H/Z4 El0ghPTX2ty/rzIL4qCdPxkDdaqUvAxT8qt91D04UrERPYctQ5oRxkDoZHKm5zWFY/bq Ec/pYOUcZLZG6LUGplucHgCaigRTEW4CV4RfUo96z/j3WpJlsK9uSwZYzVU+h5oAX/Do Yrr+gt1TCjv5Ed2F4tdRbcMAIfQq9ShDZ/L6hYfGBTtLmkIVH6DV196CQjFqWEttLfJA 3lWuV4eox6cwh+zDTPjtmySiESKAVVD9p6EAkFQaGFegDrtBTDmKJY4y7uDzBSwojwcb N1UA== 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:dkim-signature; bh=lBPdDjemhVHEdTvges9UmlJ1LQEDyrXReCC0qW2qybY=; fh=THs6guOqkLDmbqBk6y/gjfuIoWFk6V2gfUI5ZhW6rjo=; b=QENfyana10wGHO6csR0mol07QetQ+sF53KTKMqTsbx2LJh8NacfItvGPgMClSMFx6V EsJKf4pYXU6clerDevKtJgGIUcyscc+zEP3tPixrY6EGl37ev/pPv+nqfvJxCvWDT04d l8segff5E9XwK44EvXWrdjk71RNrIo+3/CJlWO550OPb7fx1LliuRbOfsmCYLs1Fs0hA VBGpjtM+tmDJjHqEydX4hsUpkcU6vwFFwAI0BrCJ6JNCNGBfiXRNAB5yqX0CBXP/wRvr 98APbXeT6A/6STWmLU0Ypd1TWm62CJAdM94nKqRdo9BJjvDsp7KkHIGWuWaAflwrD2ZF Xi9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=mFSnB5pA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i3-20020a635403000000b005c1b5a2be77si4593889pgb.702.2023.12.10.09.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 09:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=mFSnB5pA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D8F718080E25; Sun, 10 Dec 2023 09:48:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbjLJRsT (ORCPT + 99 others); Sun, 10 Dec 2023 12:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjLJRsS (ORCPT ); Sun, 10 Dec 2023 12:48:18 -0500 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29286FC for ; Sun, 10 Dec 2023 09:48:24 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNudrI7QgoJwrCNudrE128; Sun, 10 Dec 2023 18:48:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702230502; bh=lBPdDjemhVHEdTvges9UmlJ1LQEDyrXReCC0qW2qybY=; h=From:To:Cc:Subject:Date; b=mFSnB5pAeg6rY7xHcKVfo6rQQienz7/0t99YSnk1T24Rxu1Mw4XoHgC8qg/Cct1XM EHjZ5X1GahrP32evCuHkKA9dXUBkaNdeZ0Y1/gksOdZ7YYS+sGWCg4GGszn3WHtuNS eg1r7SxuEzS7I+auiD0fp/imJyUL8h8MUJP2NlX4fyjyosQFVehOY3yLlIdj36iLSz 0wXoOvr8P7NmIvZU8bfMWKqxkje1GOjlbD4bTJ97JuN6qCLpOYmBIEi6LfPE2cUMkQ cF1A1w73kvWvcy5pqNIuUUbOLBCdUWEdgTquZT5ycAw60uZHm/UyC/84ZXU0HKm9D9 fKo20h/TJaBPA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:48:22 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH] drivers/perf: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:48:18 +0100 Message-Id: <85b0b73a1b2f743dd5db15d4765c7685100de27f.1702230488.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 10 Dec 2023 09:48:34 -0800 (PST) ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET --- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 5cf770a1bc31..9685645bfe04 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -617,7 +617,7 @@ static int ddr_perf_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pmu); - pmu->id = ida_simple_get(&ddr_ida, 0, 0, GFP_KERNEL); + pmu->id = ida_alloc(&ddr_ida, GFP_KERNEL); name = devm_kasprintf(&pdev->dev, GFP_KERNEL, DDR_PERF_DEV_NAME "%d", pmu->id); if (!name) { ret = -ENOMEM; @@ -674,7 +674,7 @@ static int ddr_perf_probe(struct platform_device *pdev) cpuhp_remove_multi_state(pmu->cpuhp_state); cpuhp_state_err: format_string_err: - ida_simple_remove(&ddr_ida, pmu->id); + ida_free(&ddr_ida, pmu->id); dev_warn(&pdev->dev, "i.MX9 DDR Perf PMU failed (%d), disabled\n", ret); return ret; } @@ -688,7 +688,7 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); - ida_simple_remove(&ddr_ida, pmu->id); + ida_free(&ddr_ida, pmu->id); return 0; } -- 2.34.1