Commit 20a264c9 authored by Tzung-Bi Shih's avatar Tzung-Bi Shih

platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_get_host_event()

It is overkill to crash the kernel if the `ec_dev` doesn't support MKBP
event but gets called into cros_ec_get_host_event().

Drop the BUG_ON() and return error (0 in the case) instead.
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220513044143.1045728-5-tzungbi@kernel.org
parent c2dcb1b0
...@@ -817,7 +817,8 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev) ...@@ -817,7 +817,8 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
{ {
u32 host_event; u32 host_event;
BUG_ON(!ec_dev->mkbp_event_supported); if (!ec_dev->mkbp_event_supported)
return 0;
if (ec_dev->event_data.event_type != EC_MKBP_EVENT_HOST_EVENT) if (ec_dev->event_data.event_type != EC_MKBP_EVENT_HOST_EVENT)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment