diff mbox series

[v0,13/42] power: reset: Check notifier registration return value

Message ID 20211108101157.15189-14-bp@alien8.de (mailing list archive)
State Not Applicable, 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-pm@vger.kernel.org
---
 drivers/power/reset/ltc2952-poweroff.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
index fbb344353fe4..6ca251e4b1be 100644
--- a/drivers/power/reset/ltc2952-poweroff.c
+++ b/drivers/power/reset/ltc2952-poweroff.c
@@ -279,8 +279,10 @@  static int ltc2952_poweroff_probe(struct platform_device *pdev)
 	pm_power_off = ltc2952_poweroff_kill;
 
 	data->panic_notifier.notifier_call = ltc2952_poweroff_notify_panic;
-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &data->panic_notifier);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &data->panic_notifier))
+		pr_warn("LTC2952 panic notifier already registered\n");
+
 	dev_info(&pdev->dev, "probe successful\n");
 
 	return 0;