Skip to content

Commit 6e40f14

Browse files
hghimiralucasdemarchi
authored andcommitted
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]>
1 parent 22bf0bc commit 6e40f14

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,8 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
520520
err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini,
521521
&keclass->base);
522522
if (err)
523-
drm_warn(&xe->drm,
524-
"%s: drmm_add_action_or_reset failed, err: %d\n",
525-
__func__, err);
523+
return NULL;
524+
526525
return keclass;
527526
}
528527

@@ -553,13 +552,8 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,
553552
if (err)
554553
goto err_object;
555554

556-
err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini,
557-
kobj);
558-
if (err)
559-
drm_warn(&xe->drm,
560-
"%s: drmm_add_action_or_reset failed, err: %d\n",
561-
__func__, err);
562-
return err;
555+
return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj);
556+
563557
err_object:
564558
kobject_put(kobj);
565559
return err;
@@ -708,14 +702,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
708702
goto err_object;
709703
}
710704

711-
err = drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini,
712-
kobj);
713-
if (err)
714-
drm_warn(&xe->drm,
715-
"%s: drmm_add_action_or_reset failed, err: %d\n",
716-
__func__, err);
705+
return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj);
717706

718-
return err;
719707
err_object:
720708
kobject_put(kobj);
721709
return err;

0 commit comments

Comments
 (0)