diff mbox series

[v0,40/42] EDAC/altera: Check notifier registration return value

Message ID 20211108101157.15189-41-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: linux-edac@vger.kernel.org
---
 drivers/edac/altera_edac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 3a6d2416cb0f..49fa7ae77ba3 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2125,8 +2125,10 @@  static int altr_edac_a10_probe(struct platform_device *pdev)
 		int dberror, err_addr;
 
 		edac->panic_notifier.notifier_call = s10_edac_dberr_handler;
-		atomic_notifier_chain_register(&panic_notifier_list,
-					       &edac->panic_notifier);
+
+		if (atomic_notifier_chain_register(&panic_notifier_list,
+						   &edac->panic_notifier))
+			pr_warn("Panic notifier already registered\n");
 
 		/* Printout a message if uncorrectable error previously. */
 		regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_VAL_OFST,