]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/connector: Remove usage of the deprecated ida_simple_xxx API
authorBo Liu <liubo03@inspur.com>
Fri, 17 Jun 2022 08:23:19 +0000 (04:23 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 24 Jun 2022 22:04:19 +0000 (00:04 +0200)
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 <liubo03@inspur.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617082319.7599-1-liubo03@inspur.com
Link: https://patchwork.freedesktop.org/patch/msgid/20220621190055.8323-1-jiangjian@cdjrlc.com
drivers/gpu/drm/drm_connector.c

index 28ea0f8196b9bbbddc16805552f43a376d5295dd..c7ca435ceb95546e3064bd574c9f9c6672985002 100644 (file)
@@ -251,7 +251,7 @@ int drm_connector_init(struct drm_device *dev,
        connector->funcs = funcs;
 
        /* connector index is used with 32bit bitmasks */
-       ret = ida_simple_get(&config->connector_ida, 0, 32, GFP_KERNEL);
+       ret = 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,
@@ -263,7 +263,7 @@ int drm_connector_init(struct drm_device *dev,
 
        connector->connector_type = connector_type;
        connector->connector_type_id =
-               ida_simple_get(connector_ida, 1, 0, GFP_KERNEL);
+               ida_alloc_min(connector_ida, 1, GFP_KERNEL);
        if (connector->connector_type_id < 0) {
                ret = connector->connector_type_id;
                goto out_put_id;
@@ -323,10 +323,10 @@ int drm_connector_init(struct drm_device *dev,
        connector->debugfs_entry = 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);
@@ -480,11 +480,10 @@ void drm_connector_cleanup(struct drm_connector *connector)
        list_for_each_entry_safe(mode, t, &connector->modes, head)
                drm_mode_remove(connector, mode);
 
-       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);
 
-       ida_simple_remove(&dev->mode_config.connector_ida,
-                         connector->index);
+       ida_free(&dev->mode_config.connector_ida, connector->index);
 
        kfree(connector->display_info.bus_formats);
        drm_mode_object_unregister(dev, &connector->base);