summaryrefslogtreecommitdiff
path: root/drivers/staging/sm750fb
diff options
context:
space:
mode:
authorElise Lennion <elise.lennion@gmail.com>2016-10-28 03:22:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-30 18:13:11 +0300
commitcefc2fc61e1f5c80c6240634da01a4b846e9a6db (patch)
tree0caf7329dfa5646bdda9f7896496672f65fedbb7 /drivers/staging/sm750fb
parent1fda5b7566561c8e1fc6fd572cbdc7ec32051b16 (diff)
downloadlinux-cefc2fc61e1f5c80c6240634da01a4b846e9a6db.tar.xz
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: Elise Lennion <elise.lennion@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r--drivers/staging/sm750fb/ddk750_power.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index c9ea464e2a78..6c15b1253240 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -74,26 +74,10 @@ void set_power_mode(unsigned int powerMode)
void set_current_gate(unsigned int gate)
{
- unsigned int gate_reg;
- unsigned int mode;
-
- /* Get current power mode. */
- 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);
+ if (getPowerMode() == POWER_MODE_CTRL_MODE_MODE1)
+ POKE32(MODE1_GATE, gate);
+ else
+ POKE32(MODE0_GATE, gate);
}