diff mbox series

[v0,07/42] drm/i915: Check notifier registration return value

Message ID 20211108101157.15189-8-bp@alien8.de (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Borislav Petkov Nov. 8, 2021, 10:11 a.m. UTC
From: Borislav Petkov <bp@suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: intel-gvt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
---
 drivers/gpu/drm/i915/gvt/scheduler.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index 6c804102528b..3bafaca5789f 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -1277,8 +1277,10 @@  int intel_gvt_init_workload_scheduler(struct intel_gvt *gvt)
 
 		gvt->shadow_ctx_notifier_block[i].notifier_call =
 					shadow_context_status_change;
-		atomic_notifier_chain_register(&engine->context_status_notifier,
-					&gvt->shadow_ctx_notifier_block[i]);
+
+		if (atomic_notifier_chain_register(&engine->context_status_notifier,
+						   &gvt->shadow_ctx_notifier_block[i]))
+			pr_warn("Context status notifier %d already registered\n", i);
 	}
 
 	return 0;