diff options
author | Peter Marheine <pmarheine@chromium.org> | 2023-04-11 11:30:05 +1000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-12 01:53:04 +0000 |
commit | eeff2ef395c8b6af3be88b71b4671a1f41702d08 (patch) | |
tree | d2999cc1fff0b32b13f7c7ea3233e5ba0044e166 | |
parent | 9a2f21a9f682ee10ef301caef399836d9a695cae (diff) | |
download | chrome-ec-eeff2ef395c8b6af3be88b71b4671a1f41702d08.tar.gz |
adc: don't declare adc_channels if ADC support is disabled
If CONFIG_ADC is disabled, `struct adc_t` may not be defined in which
case declaring adc_channels using that type is an error.
BUG=b:267959470
TEST=Including adc.h with CONFIG_ADC disabled no longer causes an error.
BRANCH=none
Change-Id: I9cbc5b14a5e5a7f3307925c5bcd0da6e84b79758
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4402419
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | include/adc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/adc.h b/include/adc.h index ddb6c8246e..a73b4ac9aa 100644 --- a/include/adc.h +++ b/include/adc.h @@ -17,6 +17,7 @@ #include <zephyr_adc.h> #endif /* CONFIG_ZEPHYR */ +#ifdef CONFIG_ADC /* * Boards must provide this list of ADC channel definitions. This must match * the enum adc_channel list provided by the board. @@ -26,6 +27,7 @@ extern const struct adc_t adc_channels[]; #else extern struct adc_t adc_channels[]; #endif +#endif /* CONFIG_ADC */ /** * ADC initial. |