]> Git Repo - J-u-boot.git/commitdiff
board: ti: am43xx: replace if else if else with a switch
authorFelipe Balbi <[email protected]>
Mon, 22 Dec 2014 22:26:13 +0000 (16:26 -0600)
committerTom Rini <[email protected]>
Tue, 13 Jan 2015 16:53:39 +0000 (11:53 -0500)
A switch statement fits better in this case,
specially considering we have a few extra
frequencies to use.

Signed-off-by: Felipe Balbi <[email protected]>
board/ti/am43xx/board.c

index 9874773bab955349ead828e6d78259ed092e0468..c418e68464a8a26e37c143de83294ad2e0882676 100644 (file)
@@ -381,11 +381,14 @@ void scale_vcores(void)
        if (i2c_probe(TPS65218_CHIP_PM))
                return;
 
        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;
                mpu_vdd = TPS65218_DCDC_VOLT_SEL_1330MV;
-       } else if (mpu_params->m == 600) {
+               break;
+       case 600:
                mpu_vdd = TPS65218_DCDC_VOLT_SEL_1100MV;
                mpu_vdd = TPS65218_DCDC_VOLT_SEL_1100MV;
-       } else {
+               break;
+       default:
                puts("Unknown MPU clock, not scaling\n");
                return;
        }
                puts("Unknown MPU clock, not scaling\n");
                return;
        }
This page took 0.037573 seconds and 4 git commands to generate.