diff mbox series

[v0,41/42] power: supply: ab8500: Check notifier registration return value

Message ID 20211108101157.15189-42-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/supply/ab8500_charger.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 15eadaf46f14..de99f070cbc2 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3644,10 +3644,10 @@  static int ab8500_charger_probe(struct platform_device *pdev)
 	}
 
 	/* Notifier for external charger enabling */
-	if (!di->ac_chg.enabled)
-		blocking_notifier_chain_register(
-			&charger_notifier_list, &charger_nb);
-
+	if (!di->ac_chg.enabled) {
+		if (blocking_notifier_chain_register(&charger_notifier_list, &charger_nb))
+			pr_warn("Charger notifier already registered\n");
+	}
 
 	di->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
 	if (IS_ERR_OR_NULL(di->usb_phy)) {