diff options
author | Rajesh Kumar <rajesh3.kumar@intel.com> | 2022-01-12 10:16:35 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-13 00:43:32 +0000 |
commit | 15adfa125e101b8162ca5f74221c5cdabb960464 (patch) | |
tree | a5c398688c9a701f2cffe6a4e016a44a27cc3f7b | |
parent | da4816c675b642cbac08457ab78f57bfe3f02ea7 (diff) | |
download | chrome-ec-15adfa125e101b8162ca5f74221c5cdabb960464.tar.gz |
zephyr: ioex: Fix crash when cros ioex drivers disabled
EC crash in ioex_init() if the following Kconfig options are set:
CONFIG_PLATFORM_EC_IOEX=y
CONFIG_PLATFORM_EC_IOEX_CROS_DRV=n
returning EC_SUCCESS if CONFIG_PLATFORM_EC_IOEX_CROS_DRV is not enabled.
BUG=none
BRANCH=none
TEST=zmake testall
Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com>
Change-Id: I51e83b14e46efd605e23922c9025a1aaa03f1098
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3384475
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/shim/src/ioex.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/zephyr/shim/src/ioex.c b/zephyr/shim/src/ioex.c index 11255b0407..7d9ba99946 100644 --- a/zephyr/shim/src/ioex.c +++ b/zephyr/shim/src/ioex.c @@ -274,6 +274,9 @@ static void ioex_isr(const struct device *port, int ioex_init(int ioex) { + if (!IS_ENABLED(CONFIG_PLATFORM_EC_IOEX_CROS_DRV)) + return EC_SUCCESS; + const struct ioexpander_drv *drv = ioex_config[ioex].drv; int rv; |