summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2022-05-13 07:41:40 +0300
committerTzung-Bi Shih <tzungbi@kernel.org>2022-05-16 05:01:51 +0300
commit20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e (patch)
treef55f72040ed18329c207a1d0a25b0950af2428b8 /drivers/platform
parentc2dcb1b06053a1ccfb73fe84e7b54b92383401cc (diff)
downloadlinux-20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e.tar.xz
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: Guenter Roeck <groeck@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220513044143.1045728-5-tzungbi@kernel.org
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/chrome/cros_ec_proto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index 9ce3374846ff..ff767dccdf0f 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -817,7 +817,8 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
{
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)
return 0;