From 068ea0a8a8f8776142946ac684ec77bbf0704fa6 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 22 Dec 2014 16:26:13 -0600 Subject: board: ti: am43xx: replace if else if else with a switch A switch statement fits better in this case, specially considering we have a few extra frequencies to use. Signed-off-by: Felipe Balbi --- board/ti/am43xx/board.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 9874773bab..c418e68464 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -381,11 +381,14 @@ void scale_vcores(void) if (i2c_probe(TPS65218_CHIP_PM)) return; - if (mpu_params->m == 1000) { + switch (mpu_params->m) { + case 1000: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1330MV; - } else if (mpu_params->m == 600) { + break; + case 600: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1100MV; - } else { + break; + default: puts("Unknown MPU clock, not scaling\n"); return; } -- cgit v1.2.3