From bfaac2c2e9f55018edda489a1e04678685897b51 Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Thu, 3 Oct 2019 10:39:24 +0800 Subject: audio_codec: fix compile error Fixes compile error: error: initialization of 'int (*)(struct host_cmd_handler_args *)' from incompatible pointer type 'enum ec_status (*)(struct host_cmd_handler_args *)' [-Werror=incompatible-pointer-types] Commit 83d793839 ("host_command: Change host command return value to enum ec_status") changes return code to enum ec_status for host commands. Changes the function pointers accordingly. BRANCH=none BUG=chromium:1004831 BUG=b:123268236 TEST=make BOARD=kukui_scp clean && make BOARD=kukui_scp -j Change-Id: I8d38cbd732746b3fc0098b22d1faa2f04716d275 Signed-off-by: Tzung-Bi Shih Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1835881 Reviewed-by: Nicolas Boichat --- common/audio_codec.c | 2 +- common/audio_codec_dmic.c | 2 +- common/audio_codec_i2s_rx.c | 2 +- common/audio_codec_wov.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/audio_codec.c b/common/audio_codec.c index fde79b4129..3f7203ad15 100644 --- a/common/audio_codec.c +++ b/common/audio_codec.c @@ -84,7 +84,7 @@ static enum ec_status set_shm_addr(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } -static int (*sub_cmds[])(struct host_cmd_handler_args *) = { +static enum ec_status (*sub_cmds[])(struct host_cmd_handler_args *) = { [EC_CODEC_GET_CAPABILITIES] = get_capabilities, [EC_CODEC_GET_SHM_ADDR] = get_shm_addr, [EC_CODEC_SET_SHM_ADDR] = set_shm_addr, diff --git a/common/audio_codec_dmic.c b/common/audio_codec_dmic.c index 58827440cc..c4f0b07a46 100644 --- a/common/audio_codec_dmic.c +++ b/common/audio_codec_dmic.c @@ -46,7 +46,7 @@ static enum ec_status dmic_get_gain_idx(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } -static int (*sub_cmds[])(struct host_cmd_handler_args *) = { +static enum ec_status (*sub_cmds[])(struct host_cmd_handler_args *) = { [EC_CODEC_DMIC_GET_MAX_GAIN] = dmic_get_max_gain, [EC_CODEC_DMIC_SET_GAIN_IDX] = dmic_set_gain_idx, [EC_CODEC_DMIC_GET_GAIN_IDX] = dmic_get_gain_idx, diff --git a/common/audio_codec_i2s_rx.c b/common/audio_codec_i2s_rx.c index b5c3be4926..700fc41024 100644 --- a/common/audio_codec_i2s_rx.c +++ b/common/audio_codec_i2s_rx.c @@ -84,7 +84,7 @@ static enum ec_status i2s_rx_set_bclk(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } -static int (*sub_cmds[])(struct host_cmd_handler_args *) = { +static enum ec_status (*sub_cmds[])(struct host_cmd_handler_args *) = { [EC_CODEC_I2S_RX_ENABLE] = i2s_rx_enable, [EC_CODEC_I2S_RX_DISABLE] = i2s_rx_disable, [EC_CODEC_I2S_RX_SET_SAMPLE_DEPTH] = i2s_rx_set_sample_depth, diff --git a/common/audio_codec_wov.c b/common/audio_codec_wov.c index 141403f783..f84e45f342 100644 --- a/common/audio_codec_wov.c +++ b/common/audio_codec_wov.c @@ -292,7 +292,7 @@ static enum ec_status wov_read_audio(struct host_cmd_handler_args *args) } #endif /* CONFIG_AUDIO_CODEC_CAP_WOV_AUDIO_SHM */ -static int (*sub_cmds[])(struct host_cmd_handler_args *) = { +static enum ec_status (*sub_cmds[])(struct host_cmd_handler_args *) = { #ifdef CONFIG_AUDIO_CODEC_CAP_WOV_LANG_SHM [EC_CODEC_WOV_SET_LANG_SHM] = wov_set_lang_shm, #else -- cgit v1.2.1