diff mbox series

[v0,09/42] iio: proximity: cros_ec: Check notifier registration return value

Message ID 20211108101157.15189-10-bp@alien8.de (mailing list archive)
State Not Applicable
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-iio@vger.kernel.org
---
 drivers/iio/proximity/cros_ec_mkbp_proximity.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c
index 8213b0081713..e9536de8dd8a 100644
--- a/drivers/iio/proximity/cros_ec_mkbp_proximity.c
+++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c
@@ -234,7 +234,8 @@  static int cros_ec_mkbp_proximity_probe(struct platform_device *pdev)
 		return ret;
 
 	data->notifier.notifier_call = cros_ec_mkbp_proximity_notify;
-	blocking_notifier_chain_register(&ec->event_notifier, &data->notifier);
+	if (blocking_notifier_chain_register(&ec->event_notifier, &data->notifier))
+		pr_warn("cros-ec proximity notifier already registered\n");
 
 	return 0;
 }