summaryrefslogtreecommitdiff
path: root/chip/lm4/i2c.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-23 14:12:25 -0700
committerGerrit <chrome-bot@google.com>2012-10-23 16:49:29 -0700
commite72788ef96e83ef9d6ac0b2593c7edd8139c9376 (patch)
tree8eab899042c277b835310e9c35d9ee8180b14837 /chip/lm4/i2c.c
parent7cd4d4391d3abbd2272bf9b7459677a4fa99cd0c (diff)
downloadchrome-ec-e72788ef96e83ef9d6ac0b2593c7edd8139c9376.tar.gz
Hook functions no longer return values
Previously, all hook functions returned EC_SUCCESS, which was meaningless because nothing ever looked at the return value. Changing the return value to void saves ~100 bytes of code size and an equal amount of source code size. BUG=none BRANCH=none TEST=code still builds; link still boots Change-Id: I2a636339894e5a804831244967a9c9d134df7d13 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36372
Diffstat (limited to 'chip/lm4/i2c.c')
-rw-r--r--chip/lm4/i2c.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c
index 94ae391712..de04bcf727 100644
--- a/chip/lm4/i2c.c
+++ b/chip/lm4/i2c.c
@@ -5,15 +5,15 @@
/* I2C port module for Chrome EC */
-#include "board.h"
#include "clock.h"
+#include "common.h"
#include "console.h"
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
+#include "registers.h"
#include "task.h"
#include "timer.h"
-#include "registers.h"
#include "util.h"
#define CPUTS(outstr) cputs(CC_I2C, outstr)
@@ -279,8 +279,7 @@ exit:
return rv;
}
-
-static int i2c_freq_changed(void)
+static void i2c_freq_changed(void)
{
int freq = clock_get_freq();
int i;
@@ -308,8 +307,6 @@ static int i2c_freq_changed(void)
LM4_I2C_MTPR(i2c_ports[i].port) = tpr;
}
-
- return EC_SUCCESS;
}
DECLARE_HOOK(HOOK_FREQ_CHANGE, i2c_freq_changed, HOOK_PRIO_DEFAULT + 1);
@@ -475,8 +472,7 @@ static void configure_gpio(void)
#endif
}
-
-static int i2c_init(void)
+static void i2c_init(void)
{
volatile uint32_t scratch __attribute__((unused));
uint32_t mask = 0;
@@ -510,7 +506,5 @@ static int i2c_init(void)
task_enable_irq(LM4_IRQ_I2C3);
task_enable_irq(LM4_IRQ_I2C4);
task_enable_irq(LM4_IRQ_I2C5);
-
- return EC_SUCCESS;
}
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);