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 <prathampratap@codeaurora.org>
This commit is contained in:
Pratham Pratap
2021-04-09 17:59:37 +05:30
parent 5475cd6f75
commit 16fee6ee7a

View File

@@ -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);