summaryrefslogtreecommitdiff
path: root/board/bds/board.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-10-04 11:28:48 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-07 16:20:59 +0000
commit57aaa0267ec042d8b36aacf5b3efba12df4e6ec2 (patch)
treefea9614f2048f9866b1f6333a534c15cab4056e0 /board/bds/board.c
parent616cc446e2cc8acb5506592ba1f965d4c06f9b2b (diff)
downloadchrome-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/bds/board.c')
-rw-r--r--board/bds/board.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/bds/board.c b/board/bds/board.c
index 915679d4c3..a9c9a16df6 100644
--- a/board/bds/board.c
+++ b/board/bds/board.c
@@ -36,7 +36,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
const struct i2c_port_t i2c_ports[] = {
{"lightbar", I2C_PORT_LIGHTBAR, 400},
};
-BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_PORTS_USED);
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
/* GPIO signal list. Must match order from enum gpio_signal. */