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/pit | |
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/pit')
-rw-r--r-- | board/pit/board.c | 2 | ||||
-rw-r--r-- | board/pit/board.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/board/pit/board.c b/board/pit/board.c index 8586124bd9..af7d12715f 100644 --- a/board/pit/board.c +++ b/board/pit/board.c @@ -109,7 +109,7 @@ const struct battery_temperature_ranges bat_temp_ranges = { 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); struct keyboard_scan_config keyscan_config = { .output_settle_us = 40, diff --git a/board/pit/board.h b/board/pit/board.h index c62faff1a3..c9c82e5048 100644 --- a/board/pit/board.h +++ b/board/pit/board.h @@ -58,7 +58,6 @@ enum module_id { #define I2C_PORT_BATTERY I2C_PORT_HOST #define I2C_PORT_CHARGER I2C_PORT_HOST #define I2C_PORT_SLAVE 1 -#define I2C_PORTS_USED 1 /* Charger sense resistors */ #define CONFIG_CHARGER_SENSE_RESISTOR_AC 12 |