[PATCH] drm/amd/display: only call sysfs_remove_group() for eDP connectors

Hamza Mahfooz hamza.mahfooz at amd.com
Mon Feb 5 15:18:28 UTC 2024


Since we only register the amdgpu sysfs group for eDP connectors, we
should only remove it from them. Otherwise, we run into a harmless
WARN() on device detach for all of the device's non-eDP connectors.

Fixes: f97e4303da16 ("drm/amd/display: add panel_power_savings sysfs entry to eDP connectors")
Signed-off-by: Hamza Mahfooz <hamza.mahfooz at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index adda423615a1..b3a5e730be24 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6508,7 +6508,9 @@ static void amdgpu_dm_connector_unregister(struct drm_connector *connector)
 {
 	struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
 
-	sysfs_remove_group(&connector->kdev->kobj, &amdgpu_group);
+	if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
+		sysfs_remove_group(&connector->kdev->kobj, &amdgpu_group);
+
 	drm_dp_aux_unregister(&amdgpu_dm_connector->dm_dp_aux.aux);
 }
 
-- 
2.43.0



More information about the amd-gfx mailing list