summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martinroth@chromium.org>2016-08-10 11:18:34 -0600
committerchrome-bot <chrome-bot@chromium.org>2016-08-10 20:07:28 -0700
commitbf5db9fac89c52d9c75ea17ae86c54565fdcafd6 (patch)
treeb4f64822d24fdf67e21d9f8d7fde04f5fe852ccf
parent0b6a09548825d55dd960180b8bba9fbc2705c962 (diff)
downloadchrome-ec-bf5db9fac89c52d9c75ea17ae86c54565fdcafd6.tar.gz
npcx/i2c: Remove static from arrays & functions used by inline function
This fixes several errors caused by these being defined as static while being used in the inline function i2c_handle_sda_irq(). From the C99 Draft 6.7.4.3: An inline definition of a function with external linkage shall not contain a definition of a modifiable object with static storage duration, and shall not contain a reference to an identifier with internal linkage. TEST=Build with GCC 5.3 flash and boot Reef board BUG=None BRANCH=None Change-Id: Ie487f17b92736c2a56280783267da5d3bb12b969 Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367486 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/npcx/i2c.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c
index 6b01b1f88a..eedefce008 100644
--- a/chip/npcx/i2c.c
+++ b/chip/npcx/i2c.c
@@ -79,7 +79,7 @@ enum smb_oper_state_t {
};
/* IRQ for each port */
-static const uint32_t i2c_irqs[I2C_CONTROLLER_COUNT] = {
+const uint32_t i2c_irqs[I2C_CONTROLLER_COUNT] = {
NPCX_IRQ_SMB1, NPCX_IRQ_SMB2, NPCX_IRQ_SMB3, NPCX_IRQ_SMB4};
BUILD_ASSERT(ARRAY_SIZE(i2c_irqs) == I2C_CONTROLLER_COUNT);
@@ -98,7 +98,7 @@ struct i2c_status {
uint32_t timeout_us;/* Transaction timeout */
};
/* I2C controller state data array */
-static struct i2c_status i2c_stsobjs[I2C_CONTROLLER_COUNT];
+struct i2c_status i2c_stsobjs[I2C_CONTROLLER_COUNT];
/* I2C timing setting */
struct i2c_timing {
@@ -335,7 +335,7 @@ enum smb_error i2c_master_transaction(int controller)
}
/* Issue stop condition if necessary and end transaction */
-static void i2c_done(int controller)
+void i2c_done(int controller)
{
volatile struct i2c_status *p_status = i2c_stsobjs + controller;