drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 29 Aug 2023 11:39:09 +0000 (14:39 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 15 Sep 2023 11:45:00 +0000 (14:45 +0300)
Use the standard onion peeling approach and call
drm_debugfs_connector_remove() and
drm_sysfs_connector_remove() in the reverse order in
drm_connector_unregister() than what we called their
add counterpartse in drm_connector_register().

The error unwiding in drm_connector_register() is
already doing this the correct way around.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de> #irc
drivers/gpu/drm/drm_connector.c

index bf8371dc2a612111a9b2aaa40e06d3f063ba6120..20e94b4ce60e0c92c0da23b396e1658375239d3b 100644 (file)
@@ -684,8 +684,8 @@ void drm_connector_unregister(struct drm_connector *connector)
        if (connector->funcs->early_unregister)
                connector->funcs->early_unregister(connector);
 
-       drm_sysfs_connector_remove(connector);
        drm_debugfs_connector_remove(connector);
+       drm_sysfs_connector_remove(connector);
 
        connector->registration_state = DRM_CONNECTOR_UNREGISTERED;
        mutex_unlock(&connector->mutex);