From 16fee6ee7a7b9de220b854651000ce46f18241fe Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Fri, 9 Apr 2021 17:59:37 +0530 Subject: [PATCH] extcon: Initialize blocking notifier while registering This change initializes the blocking notifier while registering a new extcon device. Without this a warning is observed when CONFIG_LOCKDEP is enabled since it is not as per lockdep annotation, as the driver is trying to register a non-static key. Change-Id: Ibb20fe11c4622ffd92f02508ffae5a4fb5625019 Signed-off-by: Pratham Pratap --- drivers/extcon/extcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 35ef9cd78a46..97f6d529bd0d 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1324,8 +1324,10 @@ int extcon_dev_register(struct extcon_dev *edev) goto err_dev; } - for (index = 0; index < edev->max_supported; index++) + for (index = 0; index < edev->max_supported; index++) { RAW_INIT_NOTIFIER_HEAD(&edev->nh[index]); + BLOCKING_INIT_NOTIFIER_HEAD(&edev->bnh[index]); + } RAW_INIT_NOTIFIER_HEAD(&edev->nh_all);