Commit 6e40f142 authored by Himal Prasad Ghimiray's avatar Himal Prasad Ghimiray Committed by Lucas De Marchi

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 <tejas.upadhyay@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240412181211.1155732-5-himal.prasad.ghimiray@intel.comSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 22bf0bc0
...@@ -520,9 +520,8 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char ...@@ -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, err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini,
&keclass->base); &keclass->base);
if (err) if (err)
drm_warn(&xe->drm, return NULL;
"%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
return keclass; return keclass;
} }
...@@ -553,13 +552,8 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe, ...@@ -553,13 +552,8 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,
if (err) if (err)
goto err_object; goto err_object;
err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj);
kobj);
if (err)
drm_warn(&xe->drm,
"%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
return err;
err_object: err_object:
kobject_put(kobj); kobject_put(kobj);
return err; return err;
...@@ -708,14 +702,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt) ...@@ -708,14 +702,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
goto err_object; goto err_object;
} }
err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj);
kobj);
if (err)
drm_warn(&xe->drm,
"%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
return err;
err_object: err_object:
kobject_put(kobj); kobject_put(kobj);
return err; return err;
......
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