diff options
author | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 13:21:56 +0300 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 15:22:40 +0300 |
commit | cd506a33b0d9759e0a58556799b1b38650fa3698 (patch) | |
tree | 535c2fb5d922cd6e142bbef9d53a60d029340ede /drivers/gpu/drm/xe/xe_gt.c | |
parent | 1bd985ff9fc463a72e4ceb65ae6bcb735ce93c25 (diff) | |
download | linux-cd506a33b0d9759e0a58556799b1b38650fa3698.tar.xz |
drm/xe: make gt_remove use devm
No need to hand roll the onion unwind here, just move gt_remove over to
devm which will already have the correct ordering.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240522102143.128069-31-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_gt.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_gt.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c index 98c2228b51d0..6f4b59a6e710 100644 --- a/drivers/gpu/drm/xe/xe_gt.c +++ b/drivers/gpu/drm/xe/xe_gt.c @@ -93,16 +93,14 @@ void xe_gt_sanitize(struct xe_gt *gt) gt->uc.guc.submission_state.enabled = false; } -/** - * xe_gt_remove() - Clean up the GT structures before driver removal - * @gt: the GT object - * - * This function should only act on objects/structures that must be cleaned - * before the driver removal callback is complete and therefore can't be - * deferred to a drmm action. +/* + * Clean up the GT structures before driver removal. This function should only + * act on objects/structures that must be cleaned before the driver removal + * callback is complete and therefore can't be deferred to a drmm action. */ -void xe_gt_remove(struct xe_gt *gt) +static void gt_remove(void *arg) { + struct xe_gt *gt = arg; int i; xe_uc_remove(>->uc); @@ -568,7 +566,7 @@ int xe_gt_init(struct xe_gt *gt) xe_gt_record_user_engines(gt); - return 0; + return devm_add_action_or_reset(gt_to_xe(gt)->drm.dev, gt_remove, gt); } void xe_gt_record_user_engines(struct xe_gt *gt) |