]> git.baikalelectronics.ru Git - kernel.git/commit
platform/chrome: cros_ec: fix error handling in cros_ec_register()
authorTzung-Bi Shih <tzungbi@kernel.org>
Wed, 16 Feb 2022 08:03:02 +0000 (16:03 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 18 Apr 2022 07:39:27 +0000 (15:39 +0800)
commit7b91bb37b0b6baf54969a01326e331bf5b0d02cb
tree09d587e0cb2a6eb8acabdf7a9897bc855cf1f4ff
parent6d94017b7b59bab528be97be158d0d602982e3a6
platform/chrome: cros_ec: fix error handling in cros_ec_register()

Fix cros_ec_register() to unregister platform devices if
blocking_notifier_chain_register() fails.

Also use the single exit path to handle the platform device
unregistration.

Fixes: 5ad8da0408d7 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW")
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec.c