summaryrefslogtreecommitdiff
path: root/common/pmu_tps65090.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 /common/pmu_tps65090.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 'common/pmu_tps65090.c')
-rw-r--r--common/pmu_tps65090.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c
index 2afe7aa585..d825cd028c 100644
--- a/common/pmu_tps65090.c
+++ b/common/pmu_tps65090.c
@@ -5,7 +5,6 @@
* TI TPS65090 PMU driver.
*/
-#include "board.h"
#include "clock.h"
#include "console.h"
#include "common.h"
@@ -433,7 +432,7 @@ int pmu_shutdown(void)
* Fill all of the pmu registers with known good values, this allows the
* pmu to recover by rebooting the system if its registers were trashed.
*/
-static int pmu_init_registers(void)
+static void pmu_init_registers(void)
{
const struct {
uint8_t index;
@@ -460,15 +459,14 @@ static int pmu_init_registers(void)
{AD_CTRL, 0x00},
{IRQ1_REG, 0x00}
};
- uint8_t i, rv;
+ uint8_t i;
- for (i = 0; i < ARRAY_SIZE(reg); i++) {
- rv = pmu_write(reg[i].index, reg[i].value);
- if (rv)
- return rv;
- }
-
- return EC_SUCCESS;
+ /*
+ * Write all PMU registers. Ignore return value from pmu_write()
+ * because there's nothing we can reasonably do if it fails.
+ */
+ for (i = 0; i < ARRAY_SIZE(reg); i++)
+ pmu_write(reg[i].index, reg[i].value);
}
DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, pmu_init_registers, HOOK_PRIO_DEFAULT);
@@ -531,10 +529,9 @@ void pmu_init(void)
/* Initializes PMU when power is turned on. This is necessary because the TPS'
* 3.3V rail is not powered until the power is turned on. */
-static int pmu_chipset_startup(void)
+static void pmu_chipset_startup(void)
{
pmu_init();
- return 0;
}
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, pmu_chipset_startup, HOOK_PRIO_DEFAULT);