From nobody Mon Apr 27 06:26:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F1CEC433EF for ; Thu, 16 Jun 2022 06:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358950AbiFPGmj (ORCPT ); Thu, 16 Jun 2022 02:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359002AbiFPGmh (ORCPT ); Thu, 16 Jun 2022 02:42:37 -0400 Received: from unicom145.biz-email.net (unicom145.biz-email.net [210.51.26.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0931E25 for ; Wed, 15 Jun 2022 23:42:29 -0700 (PDT) Received: from ([60.208.111.195]) by unicom145.biz-email.net ((D)) with ASMTP (SSL) id KCG00125; Thu, 16 Jun 2022 14:42:25 +0800 Received: from localhost.localdomain (10.200.104.97) by jtjnmail201601.home.langchao.com (10.100.2.1) with Microsoft SMTP Server id 15.1.2308.27; Thu, 16 Jun 2022 14:42:18 +0800 From: Bo Liu To: , , , , CC: , , Bo Liu Subject: [PATCH] drm/connector: Remove usage of the deprecated ida_simple_xxx API Date: Thu, 16 Jun 2022 01:18:29 -0400 Message-ID: <20220616051829.4071-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Originating-IP: [10.200.104.97] tUid: 20226161442258a626e91cc77798f89a1e77992f45337 X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu --- drivers/gpu/drm/drm_connector.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connecto= r.c index 1c48d162c77e..e3484b115ae6 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -250,7 +250,7 @@ int drm_connector_init(struct drm_device *dev, connector->funcs =3D funcs; =20 /* connector index is used with 32bit bitmasks */ - ret =3D ida_simple_get(&config->connector_ida, 0, 32, GFP_KERNEL); + ret =3D ida_alloc_max(&config->connector_ida, 31, GFP_KERNEL); if (ret < 0) { DRM_DEBUG_KMS("Failed to allocate %s connector index: %d\n", drm_connector_enum_list[connector_type].name, @@ -262,7 +262,7 @@ int drm_connector_init(struct drm_device *dev, =20 connector->connector_type =3D connector_type; connector->connector_type_id =3D - ida_simple_get(connector_ida, 1, 0, GFP_KERNEL); + ida_alloc_min(connector_ida, 1, GFP_KERNEL); if (connector->connector_type_id < 0) { ret =3D connector->connector_type_id; goto out_put_id; @@ -322,10 +322,10 @@ int drm_connector_init(struct drm_device *dev, connector->debugfs_entry =3D NULL; out_put_type_id: if (ret) - ida_simple_remove(connector_ida, connector->connector_type_id); + ida_free(connector_ida, connector->connector_type_id); out_put_id: if (ret) - ida_simple_remove(&config->connector_ida, connector->index); + ida_free(&config->connector_ida, connector->index); out_put: if (ret) drm_mode_object_unregister(dev, &connector->base); @@ -479,10 +479,10 @@ void drm_connector_cleanup(struct drm_connector *conn= ector) list_for_each_entry_safe(mode, t, &connector->modes, head) drm_mode_remove(connector, mode); =20 - ida_simple_remove(&drm_connector_enum_list[connector->connector_type].ida, + ida_free(&drm_connector_enum_list[connector->connector_type].ida, connector->connector_type_id); =20 - ida_simple_remove(&dev->mode_config.connector_ida, + ida_free(&dev->mode_config.connector_ida, connector->index); =20 kfree(connector->display_info.bus_formats); --=20 2.27.0