[PATCH 2/4] drm/xe: Incase of action add failure, remove sysfs only once.

Himal Prasad Ghimiray himal.prasad.ghimiray at intel.com
Mon Apr 8 12:48:28 UTC 2024


The drmm_add_action_or_reset function automatically invokes the action
(sysfs removal) in the event of a failure; therefore, there's no
necessity to call it within the return check. Additionally, it issues a
warning regarding the failure to add the action. Consequently, there's
no requirement to print a nearly identical warning within the xe driver.

Fixes: f3bc5bb4d53d ("drm/xe: Allow userspace to configure CCS mode")
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura at intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
---
 drivers/gpu/drm/xe/xe_gt_ccs_mode.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
index 529fc286cd06..31d615ce0d90 100644
--- a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
+++ b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
@@ -183,9 +183,6 @@ void xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
 	}
 
 	err = drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
-	if (err) {
-		sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs);
-		drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
-			 __func__, err);
-	}
+	if (err)
+		drm_warn(&xe->drm, "Sysfs removed for ccs_mode.\n");
 }
-- 
2.25.1



More information about the Intel-xe mailing list