diff mbox series

[01/12] drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove()

Message ID 20230829113920.13713-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Populate connector->ddc always | expand

Commit Message

Ville Syrjälä Aug. 29, 2023, 11:39 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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>
---
 drivers/gpu/drm/drm_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula Aug. 30, 2023, 11:52 a.m. UTC | #1
On Tue, 29 Aug 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/drm_connector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index c44d5bcf1284..988996cf6da5 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index c44d5bcf1284..988996cf6da5 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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);