Commit 43e82fb9 authored by Tejas Upadhyay's avatar Tejas Upadhyay Committed by Rodrigo Vivi

drm/xe: make GT sysfs init return void

Currently return from xe_gt_sysfs_init() is ignored
and also a failure in xe_gt_sysfs_init() isn't fatal
so make it return void.

V2 :
   - add drm_warn in error paths - Himal
   - Edit commit message - Nirmoy
Acked-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Signed-off-by: default avatarTejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent c7fac450
......@@ -29,30 +29,35 @@ static void gt_sysfs_fini(struct drm_device *drm, void *arg)
kobject_put(gt->sysfs);
}
int xe_gt_sysfs_init(struct xe_gt *gt)
void xe_gt_sysfs_init(struct xe_gt *gt)
{
struct xe_tile *tile = gt_to_tile(gt);
struct xe_device *xe = gt_to_xe(gt);
struct kobj_gt *kg;
int err;
kg = kzalloc(sizeof(*kg), GFP_KERNEL);
if (!kg)
return -ENOMEM;
if (!kg) {
drm_warn(&xe->drm, "Allocating kobject failed.\n");
return;
}
kobject_init(&kg->base, &xe_gt_sysfs_kobj_type);
kg->gt = gt;
err = kobject_add(&kg->base, tile->sysfs, "gt%d", gt->info.id);
if (err) {
drm_warn(&xe->drm, "failed to add GT sysfs directory, err: %d\n", err);
kobject_put(&kg->base);
return err;
return;
}
gt->sysfs = &kg->base;
err = drmm_add_action_or_reset(&gt_to_xe(gt)->drm, gt_sysfs_fini, gt);
if (err)
return err;
return 0;
err = drmm_add_action_or_reset(&xe->drm, gt_sysfs_fini, gt);
if (err) {
drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
return;
}
}
......@@ -8,7 +8,7 @@
#include "xe_gt_sysfs_types.h"
int xe_gt_sysfs_init(struct xe_gt *gt);
void xe_gt_sysfs_init(struct xe_gt *gt);
static inline struct xe_gt *
kobj_to_gt(struct kobject *kobj)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment