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

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.com


Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 22bf0bc0
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -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;