[Intel-xe] [PATCH 2/2] drm/xe: make GT sysfs init return void
Nirmoy Das
nirmoy.das at linux.intel.com
Mon Jul 3 19:38:54 UTC 2023
On 7/3/2023 11:19 AM, Tejas Upadhyay wrote:
> As we dont use return from xe_gt_sysfs_init, we
> should make it return void to make it proper return
> type.
May be "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. "
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
otherwise
Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_sysfs.c | 10 ++++------
> drivers/gpu/drm/xe/xe_gt_sysfs.h | 2 +-
> 2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> index 2c47059bef42..4ecbd972e6a1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> @@ -29,7 +29,7 @@ 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 kobj_gt *kg;
> @@ -37,7 +37,7 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
>
> kg = kzalloc(sizeof(*kg), GFP_KERNEL);
> if (!kg)
> - return -ENOMEM;
> + return;
>
> kobject_init(&kg->base, &xe_gt_sysfs_kobj_type);
> kg->gt = gt;
> @@ -45,14 +45,12 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
> err = kobject_add(&kg->base, tile->sysfs, "gt%d", gt->info.id);
> if (err) {
> kobject_put(&kg->base);
> - return err;
> + return;
> }
>
> gt->sysfs = &kg->base;
>
> err = drmm_add_action_or_reset(>_to_xe(gt)->drm, gt_sysfs_fini, gt);
> if (err)
> - return err;
> -
> - return 0;
> + return;
> }
> diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.h b/drivers/gpu/drm/xe/xe_gt_sysfs.h
> index ecbfcc5c7d42..e3ec278ca0be 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sysfs.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.h
> @@ -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)
More information about the Intel-xe
mailing list