diff options
author | Himal Prasad Ghimiray <[email protected]> | 2024-04-12 23:42:08 +0530 |
---|---|---|
committer | Lucas De Marchi <[email protected]> | 2024-04-18 13:26:34 -0700 |
commit | 6e40f142c57999ba8d274902a4eb2369b538f767 (patch) | |
tree | a6c5d3adf4fdb270de54478f951f78347c941393 | |
parent | 22bf0bc04d273ca002a47de55693797b13076602 (diff) |
drm/xe: Return NULL in case of drmm_add_action_or_reset failure
In case of drmm_add_action_or_reset failure return NULL and no need
to print warning messages as they will be printed implictly.
Cc: Tejas Upadhyay <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Reviewed-by: Lucas De Marchi <[email protected]>
Signed-off-by: Himal Prasad Ghimiray <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
-rw-r--r-- | drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c index c5084d94c442..daab970f8be8 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c @@ -520,9 +520,8 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini, &keclass->base); if (err) - drm_warn(&xe->drm, - "%s: drmm_add_action_or_reset failed, err: %d\n", - __func__, err); + return NULL; + return keclass; } @@ -553,13 +552,8 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe, if (err) goto err_object; - err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, - kobj); - if (err) - drm_warn(&xe->drm, - "%s: drmm_add_action_or_reset failed, err: %d\n", - __func__, err); - return err; + return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj); + err_object: kobject_put(kobj); return err; @@ -708,14 +702,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt) goto err_object; } - err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, - kobj); - if (err) - drm_warn(&xe->drm, - "%s: drmm_add_action_or_reset failed, err: %d\n", - __func__, err); + return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj); - return err; err_object: kobject_put(kobj); return err; |