diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-10-04 11:28:48 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-07 16:20:59 +0000 |
commit | 57aaa0267ec042d8b36aacf5b3efba12df4e6ec2 (patch) | |
tree | fea9614f2048f9866b1f6333a534c15cab4056e0 /board/kirby | |
parent | 616cc446e2cc8acb5506592ba1f965d4c06f9b2b (diff) | |
download | chrome-ec-57aaa0267ec042d8b36aacf5b3efba12df4e6ec2.tar.gz |
cleanup: Replace awkward I2C_PORTS_USED macro with constant
We only used I2C_PORTS_USED to iterate through the list of hardware ports
actually in use, but we defined it in board.h at the same place where we
matched particular I2C devices to the (possibly shared) buses they're on.
This CL makes I2C_PORTS_USED into a global constant, so it can be set
automatically where we initialize the ports, and doesn't have to be
related to the list of attached devices.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual
Build everything, run all tests, should still work.
Change-Id: I65f22f5cadfc4b3afe51af48faa5fb369bc3aa09
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171884
Diffstat (limited to 'board/kirby')
-rw-r--r-- | board/kirby/board.c | 2 | ||||
-rw-r--r-- | board/kirby/board.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/board/kirby/board.c b/board/kirby/board.c index 3ee9acfd7a..4cac7b6d9f 100644 --- a/board/kirby/board.c +++ b/board/kirby/board.c @@ -139,7 +139,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); const struct i2c_port_t i2c_ports[] = { {"host", I2C_PORT_HOST, 100}, }; -BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_PORTS_USED); +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); static void board_update_backlight(void) { diff --git a/board/kirby/board.h b/board/kirby/board.h index f5645c577e..1fa62bfa88 100644 --- a/board/kirby/board.h +++ b/board/kirby/board.h @@ -60,7 +60,6 @@ enum module_id { #define I2C_PORT_HOST 0 #define I2C_PORT_BATTERY I2C_PORT_HOST #define I2C_PORT_CHARGER I2C_PORT_HOST -#define I2C_PORTS_USED 1 /* Timer selection */ #define TIM_CLOCK_MSB 2 |