[PATCH v0 28/42] soc: bcm: brcmstb: pm: pm-arm: Check notifier registration return value

From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:16:20 EST


From: Borislav Petkov <bp@xxxxxxx>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: bcm-kernel-feedback-list@xxxxxxxxxxxx
---
drivers/soc/bcm/brcmstb/pm/pm-arm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
index 3cbb165d6e30..f80068ec57cb 100644
--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
+++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
@@ -802,8 +802,9 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
goto out;
}

- atomic_notifier_chain_register(&panic_notifier_list,
- &brcmstb_pm_panic_nb);
+ if (atomic_notifier_chain_register(&panic_notifier_list,
+ &brcmstb_pm_panic_nb))
+ pr_warn("Panic notifier already registered\n");

pm_power_off = brcmstb_pm_poweroff;
suspend_set_ops(&brcmstb_pm_ops);
--
2.29.2