]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
authorTzung-Bi Shih <tzungbi@kernel.org>
Tue, 22 Jul 2025 12:05:13 +0000 (12:05 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Wed, 23 Jul 2025 02:44:39 +0000 (02:44 +0000)
The blocking notifier is registered in cros_ec_register(); however, it
isn't unregistered in cros_ec_unregister().

Fix it.

Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW")
Cc: stable@vger.kernel.org
Reviewed-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20250722120513.234031-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec.c

index 110771a8645ed7e8537ae2723b08f96e0d498118..fd58781a2fb7da8b779b8e8b9cfdc1c2a7555146 100644 (file)
@@ -318,6 +318,9 @@ EXPORT_SYMBOL(cros_ec_register);
  */
 void cros_ec_unregister(struct cros_ec_device *ec_dev)
 {
+       if (ec_dev->mkbp_event_supported)
+               blocking_notifier_chain_unregister(&ec_dev->event_notifier,
+                                                  &ec_dev->notifier_ready);
        platform_device_unregister(ec_dev->pd);
        platform_device_unregister(ec_dev->ec);
        mutex_destroy(&ec_dev->lock);