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

From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:13:41 EST


From: Borislav Petkov <bp@xxxxxxx>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: intel-gvt-dev@xxxxxxxxxxxxxxxxxxxxx
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
---
drivers/gpu/drm/i915/gvt/scheduler.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

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;
--
2.29.2