Commit cefc2fc6 authored by Elise Lennion's avatar Elise Lennion Committed by Greg Kroah-Hartman

staging: sm750fb: Refine code in set_current_gate().

The 'switch' statement in set_current_gate() had only two possible
scenarios, so it was replaced with an 'if' statement to make the code
shorter and easier to understand.
Signed-off-by: default avatarElise Lennion <elise.lennion@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1fda5b75
...@@ -74,26 +74,10 @@ void set_power_mode(unsigned int powerMode) ...@@ -74,26 +74,10 @@ void set_power_mode(unsigned int powerMode)
void set_current_gate(unsigned int gate) void set_current_gate(unsigned int gate)
{ {
unsigned int gate_reg; if (getPowerMode() == POWER_MODE_CTRL_MODE_MODE1)
unsigned int mode; POKE32(MODE1_GATE, gate);
else
/* Get current power mode. */ POKE32(MODE0_GATE, gate);
mode = getPowerMode();
switch (mode) {
case POWER_MODE_CTRL_MODE_MODE0:
gate_reg = MODE0_GATE;
break;
case POWER_MODE_CTRL_MODE_MODE1:
gate_reg = MODE1_GATE;
break;
default:
gate_reg = MODE0_GATE;
break;
}
POKE32(gate_reg, gate);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment