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) ...@@ -29,30 +29,35 @@ static void gt_sysfs_fini(struct drm_device *drm, void *arg)
kobject_put(gt->sysfs); 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_tile *tile = gt_to_tile(gt);
struct xe_device *xe = gt_to_xe(gt);
struct kobj_gt *kg; struct kobj_gt *kg;
int err; int err;
kg = kzalloc(sizeof(*kg), GFP_KERNEL); kg = kzalloc(sizeof(*kg), GFP_KERNEL);
if (!kg) if (!kg) {
return -ENOMEM; drm_warn(&xe->drm, "Allocating kobject failed.\n");
return;
}
kobject_init(&kg->base, &xe_gt_sysfs_kobj_type); kobject_init(&kg->base, &xe_gt_sysfs_kobj_type);
kg->gt = gt; kg->gt = gt;
err = kobject_add(&kg->base, tile->sysfs, "gt%d", gt->info.id); err = kobject_add(&kg->base, tile->sysfs, "gt%d", gt->info.id);
if (err) { if (err) {
drm_warn(&xe->drm, "failed to add GT sysfs directory, err: %d\n", err);
kobject_put(&kg->base); kobject_put(&kg->base);
return err; return;
} }
gt->sysfs = &kg->base; gt->sysfs = &kg->base;
err = drmm_add_action_or_reset(&gt_to_xe(gt)->drm, gt_sysfs_fini, gt); err = drmm_add_action_or_reset(&xe->drm, gt_sysfs_fini, gt);
if (err) if (err) {
return err; drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
return 0; return;
}
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "xe_gt_sysfs_types.h" #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 * static inline struct xe_gt *
kobj_to_gt(struct kobject *kobj) 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